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



##########
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:
       This is a copy from original code - refer to line 425 in changed file or 
to line 410 in original file. We have to handle exceptions in the same way here 
to keep exception contract. I just split that single try block into 2 try 
blocks moving all things which are safe to execute earlier into the new try 
block (e.g. `archiver.getArchiver().addDirectory( getWorkDirectory(), 
getPackagingIncludes(), getPackagingExcludes() );` cannot be called in the new 
try block).




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