gnodet commented on issue #417:
URL: 
https://github.com/apache/maven-jar-plugin/issues/417#issuecomment-5838310809

   This issue predates the Maven 4 API rewrite of the plugin. With the current 
`master` branch (plugin version 4.0.0-beta-2-SNAPSHOT, targeting Maven 
4.0.0-rc-7+), both concerns raised here are addressed:
   
   1. **`readonly = true` not enforced (MNG-5001):** The field is still 
declared as `@Parameter(defaultValue = "${project.build.finalName}", readonly = 
true)`. Maven 4 now enforces this via `ReadOnlyPluginParametersValidator`, 
which issues a validation warning if a read-only parameter is explicitly set in 
the plugin configuration. Hard failure can be opted into via 
`-Wmaven.invalid.readonly` (or equivalent strictness flags).
   
   2. **Lazy expression evaluation:** The concern that 
`${project.build.finalName}` is resolved at plugin execution time (and could 
differ from an earlier call to `project.getBuild().getFinalName()`) is no 
longer an issue in Maven 4. The model is fully resolved at build start, and 
late mutation of `project.build.finalName` by other plugins is not a supported 
pattern in the Maven 4 lifecycle.
   
   The plugin's `ToolExecutor` also has a safe fallback: `(mojo.finalName != 
null) ? mojo.finalName : project.getBuild().getFinalName()`, ensuring 
consistent behavior.
   
   Given that the plugin now requires Maven 4 and both root causes are 
addressed in that context, I'm closing this issue as resolved.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to