[MEAR-280] support Reproducible ear creation based on outputTimestamp
diff --git a/pom.xml b/pom.xml
index 259482b..caac3c0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
   </parent>
 
   <artifactId>maven-ear-plugin</artifactId>
-  <version>3.0.3-SNAPSHOT</version>
+  <version>3.1.0-SNAPSHOT</version>
   <packaging>maven-plugin</packaging>
 
   <name>Apache Maven EAR Plugin</name>
@@ -80,7 +80,7 @@
   </contributors>
 
   <properties>
-    <mavenArchiverVersion>3.2.0</mavenArchiverVersion>
+    <mavenArchiverVersion>3.5.0</mavenArchiverVersion>
     <mavenFilteringVersion>3.1.1</mavenFilteringVersion>
     <mavenVersion>3.0</mavenVersion>
     <javaVersion>7</javaVersion>
@@ -117,12 +117,12 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-archiver</artifactId>
-      <version>4.1.0</version>
+      <version>4.2.1</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-      <version>3.1.0</version>
+      <version>3.3.0</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
@@ -170,14 +170,6 @@
 
     <pluginManagement>
       <plugins>
-        <!--
-          TODO: maven-invoker-plugin version should come from maven-plugins pom
-        -->
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-invoker-plugin</artifactId>
-          <version>3.2.1</version>
-        </plugin>
         <plugin>
           <groupId>org.apache.rat</groupId>
           <artifactId>apache-rat-plugin</artifactId>
@@ -265,7 +257,7 @@
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-invoker-plugin</artifactId>
             <configuration>
-              <streamLogs>true</streamLogs>
+              <streamLogs>false</streamLogs>
               <!-- NOTE: Must be synced with the repo path used by AbstractEarPluginIT -->
               <localRepositoryPath>${localRepositoryPath}</localRepositoryPath>
               <goals>
diff --git a/src/it/basic/pom.xml b/src/it/basic/pom.xml
index cb4f225..9104f35 100644
--- a/src/it/basic/pom.xml
+++ b/src/it/basic/pom.xml
@@ -30,6 +30,10 @@
   <name>Maven Integration Test :: it0033</name> 
   <description>Test an EAR generation</description>
 
+  <properties>
+    <project.build.outputTimestamp>2020-05-01T12:12:12Z</project.build.outputTimestamp>
+  </properties>
+
   <build>
     <plugins>
       <plugin>
diff --git a/src/main/java/org/apache/maven/plugins/ear/EarMojo.java b/src/main/java/org/apache/maven/plugins/ear/EarMojo.java
index c29d938..b22cb5f 100644
--- a/src/main/java/org/apache/maven/plugins/ear/EarMojo.java
+++ b/src/main/java/org/apache/maven/plugins/ear/EarMojo.java
@@ -224,6 +224,16 @@
     private MavenArchiveConfiguration archive = new MavenArchiveConfiguration();

 

     /**

+     * Timestamp for reproducible output archive entries, either formatted as ISO 8601

+     * <code>yyyy-MM-dd'T'HH:mm:ssXXX</code> or as an int representing seconds since the epoch (like

+     * <a href="https://reproducible-builds.org/docs/source-date-epoch/">SOURCE_DATE_EPOCH</a>).

+     *

+     * @since 3.1.0

+     */

+    @Parameter( defaultValue = "${project.build.outputTimestamp}" )

+    private String outputTimestamp;

+

+    /**

      */

     @Component

     private MavenProjectHelper projectHelper;

@@ -327,6 +337,11 @@
             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

+            archiver.configureReproducible( outputTimestamp );

+

             getLog().debug( "Excluding " + Arrays.asList( getPackagingExcludes() ) + " from the generated EAR." );

             getLog().debug( "Including " + Arrays.asList( getPackagingIncludes() ) + " in the generated EAR." );