You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2019/10/05 17:34:44 UTC

[maven-source-plugin] branch MSOURCES-120 updated (3ebe54f -> 1279fe0)

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a change to branch MSOURCES-120
in repository https://gitbox.apache.org/repos/asf/maven-source-plugin.git.


 discard 3ebe54f  use the new project.build.outputTimestamp property
     new 1279fe0  use the new project.build.outputTimestamp property

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (3ebe54f)
            \
             N -- N -- N   refs/heads/MSOURCES-120 (1279fe0)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/it/reproducible/verify.groovy | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[maven-source-plugin] 01/01: use the new project.build.outputTimestamp property

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch MSOURCES-120
in repository https://gitbox.apache.org/repos/asf/maven-source-plugin.git

commit 1279fe02564d805e21d75cbfc8408178190fe12a
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Sat Oct 5 19:22:23 2019 +0200

    use the new project.build.outputTimestamp property
---
 src/it/reproducible/pom.xml                               |  2 +-
 src/it/reproducible/verify.groovy                         |  2 +-
 .../maven/plugins/source/AbstractSourceJarMojo.java       | 15 +++++----------
 3 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/it/reproducible/pom.xml b/src/it/reproducible/pom.xml
index 572e292..cc024f7 100644
--- a/src/it/reproducible/pom.xml
+++ b/src/it/reproducible/pom.xml
@@ -31,7 +31,7 @@
 
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <source-date-epoch>1566419331</source-date-epoch>
+    <project.build.outputTimestamp>2019-08-21T18:28:52Z</project.build.outputTimestamp>
   </properties>
 
   <build>
diff --git a/src/it/reproducible/verify.groovy b/src/it/reproducible/verify.groovy
index 83c352b..1f9ce50 100644
--- a/src/it/reproducible/verify.groovy
+++ b/src/it/reproducible/verify.groovy
@@ -73,6 +73,6 @@ zipFile.close();
 String buf = r.toString()
 println buf
 
-String expectedSha1 = System.properties['os.name'].toLowerCase().contains( 'windows' ) ? 'c7ea4f558b19c78f65795b574fe9933b83b76b63' : 'e6d0222375a93e4e3a8f2e139361d5925151c5bd'
+String expectedSha1 = System.properties['os.name'].toLowerCase().contains( 'windows' ) ? '0dee2bca2d9d016bb0a4c76394e53161997eae73' : '9ea034f864b3896945fc792d4fcc0e3978bc3252'
 
 assert buf.startsWith( "reproducible-1.0-sources.jar sha1 = $expectedSha1" )
diff --git a/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java b/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
index 94ca4fb..99f4b1a 100644
--- a/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
+++ b/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
@@ -197,14 +197,12 @@ public abstract class AbstractSourceJarMojo
     private MavenSession session;
 
     /**
-     * Value like SOURCE_DATE_EPOCH as <a href="https://reproducible-builds.org/specs/source-date-epoch/">defined in
-     * Reproducible Builds</a>: a UNIX timestamp, defined as the number of seconds, excluding leap seconds, since 01 Jan
-     * 1970 00:00:00 UTC.
+     * Timestamp for reproducible archive entries.
      *
      * @since 3.1.1
      */
-    @Parameter( name = "source-date-epoch", defaultValue = "${source-date-epoch}" )
-    private int sourceDateEpoch;
+    @Parameter( defaultValue = "${project.build.outputTimestamp}" )
+    private String outputTimestamp;
 
     // ----------------------------------------------------------------------
     // Public methods
@@ -281,11 +279,8 @@ public abstract class AbstractSourceJarMojo
 
         MavenArchiver archiver = createArchiver();
         
-        if ( sourceDateEpoch != 0 )
-        {
-            // configure for Reproducible Builds based on source date epoch value
-            archiver.getArchiver().configureReproducible( sourceDateEpoch );
-        }
+        // configure for Reproducible Builds based on outputTimestamp value
+        archiver.configureReproducible( outputTimestamp );
 
         for ( MavenProject pItem : theProjects )
         {