elharo commented on a change in pull request #10:
URL: https://github.com/apache/maven-ear-plugin/pull/10#discussion_r484452268



##########
File path: src/it/skinny-wars/verify.bsh
##########
@@ -35,12 +39,44 @@ String[] includedEntries = {
     "WEB-INF/web.xml",
     "META-INF/MANIFEST.MF"
 };
+
+// Refer to org.apache.maven.archiver.MavenArchiver.parseOutputTimestamp

Review comment:
       This is twice. How can we reuse this code?

##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -284,7 +285,33 @@ public void execute()
         // Initializes ear modules
         super.execute();
 
+        final File earFile;
+        final MavenArchiver archiver;
+        final Date reproducibleLastModifiedDate;
+        try
+        {
+            earFile = getEarFile( outputDirectory, finalName, classifier );
+            archiver = new EarMavenArchiver( getModules() );
+            final JarArchiver theJarArchiver = getJarArchiver();
+            getLog().debug( "Jar archiver implementation [" + 
theJarArchiver.getClass().getName() + "]" );
+            archiver.setArchiver( theJarArchiver );
+            archiver.setOutputFile( earFile );
+
+            archiver.setCreatedBy( "Maven EAR Plugin", 
"org.apache.maven.plugins", "maven-ear-plugin" );
+
+            // configure for Reproducible Builds based on outputTimestamp value
+            reproducibleLastModifiedDate = archiver.configureReproducible( 
outputTimestamp );
+        }
+        catch ( Exception e )

Review comment:
       be more specific about which exceptions you're catching here

##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -284,7 +285,33 @@ public void execute()
         // Initializes ear modules
         super.execute();
 
+        final File earFile;

Review comment:
       can these be moved inside the try block, if necessary by expanding the 
lines the try block covers?

##########
File path: src/it/basic/verify.bsh
##########
@@ -35,13 +39,45 @@ String[] includedEntries = {
     "META-INF/application.xml",
     "META-INF/appserver-application.xml",
 };
+
+// Refer to org.apache.maven.archiver.MavenArchiver.parseOutputTimestamp

Review comment:
       why are we not just reusing the method here? Is this also an effect of 
it being unwisely not static?




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


Reply via email to