hboutemy commented on a change in pull request #9:
URL: https://github.com/apache/maven-ear-plugin/pull/9#discussion_r494624818



##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -289,12 +296,25 @@ public void execute()
         final File earFile;
         final MavenArchiver archiver;
         final Date reproducibleLastModifiedDate;
+        File ddFile = new File( getWorkDirectory(), APPLICATION_XML_URI );
         try
         {
             earFile = getEarFile( outputDirectory, finalName, classifier );
             archiver = new EarMavenArchiver( getModules() );
-            getLog().debug( "Jar archiver implementation [" + 
jarArchiver.getClass().getName() + "]" );
-            archiver.setArchiver( jarArchiver );
+            JarArchiver theArchiver;
+            if ( ddFile.exists() )
+            {
+                final EarArchiver earArchiver = getEarArchiver();
+                earArchiver.setAppxml( ddFile );
+                theArchiver = earArchiver;
+            }
+            else
+            {
+                theArchiver = getJarArchiver();

Review comment:
       I tested and found that starting with JavaEE 5, descriptor is not 
required: but currently, EarArchiver is implemented in a way that does not 
support this condition
   ok, now I see how we must either improve EarArchiver, either do the 
workaround you did: I'll merge and document the workaround




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to