gnodet commented on issue #596: URL: https://github.com/apache/maven-jar-plugin/issues/596#issuecomment-5726368857
Actually, the right fix is to sanitize the name rather than omit it entirely. When the JDK encounters a non-modular JAR *without* `Automatic-Module-Name` on the module path, it derives a name from the JAR filename using a well-defined algorithm. When the attribute *is* present, it uses it as-is — throwing if it's invalid. So a manifest with an invalid `Automatic-Module-Name` is actually worse than no attribute at all. Omitting the attribute restores the filename-derived fallback, which is reasonable — but we can do better: apply the same sanitization the JDK would have applied to the filename, so the JAR gets a predictable, stable, named automatic module. That's what the project intended when setting the attribute. For `org.apache.geronimo.arthur.integration-test`, the sanitized name is `org.apache.geronimo.arthur.integration.test`. No consumer could have been depending on the original invalid name (the JDK would have rejected it), so this is a safe improvement. Updated the PR accordingly: https://github.com/apache/maven-archiver/pull/402 -- 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]
