plamentotev commented on a change in pull request #2: [MJAR-238] Allow setting 
of module main class
URL: https://github.com/apache/maven-jar-plugin/pull/2#discussion_r221694289
 
 

 ##########
 File path: src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java
 ##########
 @@ -76,7 +76,7 @@
     /**
      * The Jar archiver.
      */
-    @Component( role = Archiver.class, hint = "jar" )
+    @Component( role = Archiver.class, hint = "mjar" )
 
 Review comment:
   The thing is how to know if the JAR file is going to contain 
`module-info.class` or not? The inclusion of the content is delegated to 
~Maven~ Plexus Archiver:
   ```java
   archiver.getArchiver().addDirectory( contentDirectory, getIncludes(), 
getExcludes() );
   ```
   And in general the idea of `ModularJarArchiver` is to be safe to be used for 
"regular" JAR files as well. You can think for it as an `JarArchiver` that can 
handle modules if needed. The old `JarArchiver` could be used where you want to 
treat JAR strictly as archive - such as source JAR or if you explicitly want 
the module descriptor to be left unmodified (but is there such use case for the 
JAR plugin?)
   
   That being said I agree that would be better if we know in advance if we 
need `ModularJarArchiver` or `JarArchiver` based on the existance of module 
descriptor (at very least will make the code intention more explicit and easy 
to read), so if there is some acceptable way to know that I'll modify the PR.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to