maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (MJAR-260) Warn about invalid 'Automatic-Module-Name' in MANIFEST
Date Fri, 16 Nov 2018 18:56:00 GMT


ASF GitHub Bot commented on MJAR-260:

khmarbaise commented on a change in pull request #3: [MJAR-260] Fail on invalid automatic
module name

 File path: src/main/java/org/apache/maven/plugins/jar/
 @@ -223,6 +226,18 @@ public File createArchive()
             archiver.createArchive( session, project, archive );
+            JarFile javaUtilJarFile = new JarFile( jarFile );
 Review comment:
   This will result in a resource leak cause javaUtilJarFile is never closed....and doesn't
it need to reread the file(I'm ot sure about)? 
   What about reusing the archive configuration part like this and do the check before we
create the real archive? (If I correctly seen that would result in changing the IT as well)...
               if ( archive.getManifestEntries().containsKey( AUTOMATIC_MODULE_NAME ) )
                   String automaticModuleName = archive.getManifestEntries().get( AUTOMATIC_MODULE_NAME
                   if ( automaticModuleName != null )
                       if ( !isValidModuleName( automaticModuleName ) )
                           throw new MojoExecutionException( "Invalid automatic module name:
'" + automaticModuleName
                               + "'" );
               archiver.createArchive( session, project, archive );
   What do you think?
   Furthermore we might keep that in maven-jar-plugin in the first step and improve maven-archiver
to make this check easier ? Or move that into maven-archiver (could be done in createArchive()
method ) which means can be reused by other plugins as well...or even better will be checked
already there...

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> Warn about invalid 'Automatic-Module-Name' in MANIFEST
> ------------------------------------------------------
>                 Key: MJAR-260
>                 URL:
>             Project: Maven JAR Plugin
>          Issue Type: Improvement
>            Reporter: Christian Stein
>            Assignee: Christian Stein
>            Priority: Minor
> The Maven JAR Plugin should warn or even fail when an invalid name is detected within
> For details see

This message was sent by Atlassian JIRA

View raw message