gnodet opened a new pull request, #610:
URL: https://github.com/apache/maven-jar-plugin/pull/610

   [MJAR-596] Sanitize invalid Automatic-Module-Name from manifest files 
instead of failing
   
   When Automatic-Module-Name in a MANIFEST.MF file (e.g. read from the compiled
   output directory) is not a valid Java module name, apply the same 
sanitization
   algorithm the JDK uses when deriving an automatic module name from a JAR file
   name (ModulePath.cleanModuleName): replace non-alphanumeric characters with
   '.', collapse repeated dots, strip leading/trailing dots.
   
   This handles the common case where a project sets Automatic-Module-Name to
   "${project.groupId}.${project.artifactId}" and the artifactId contains 
hyphens
   (e.g. integration-test), which are legal Maven artifact identifiers but not
   valid JPMS module name segments.
   
   If the sanitized name is still not a valid Java module name (e.g. starts 
with a
   digit or contains a Java keyword), the attribute is omitted with a warning.
   
   If the name is explicitly declared in the POM via <archive><manifestEntries>,
   the build still fails immediately (MJAR-260 behaviour).
   
   Fixes: https://github.com/apache/maven-jar-plugin/issues/596
   


-- 
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