You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/01/03 12:11:43 UTC

[GitHub] [maven-apache-parent] kwin opened a new pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

kwin opened a new pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [maven-apache-parent] kwin edited a comment on pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

Posted by GitBox <gi...@apache.org>.
kwin edited a comment on pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30#issuecomment-754239741


   Activate the rule only in a profile which is activated only in case a marker file with name `asf-parent.marker` is missing. That would require adding such a file (could be empty) to the maven-apache-parent repository.
   The only other option is to deal with explicitly given profiles or system properties in case asf-parent is built.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [maven-apache-parent] kwin commented on pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

Posted by GitBox <gi...@apache.org>.
kwin commented on pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30#issuecomment-754235368


   Seems we need to disable the enforcer check for the build of asf parent itself


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [maven-apache-parent] michael-o commented on pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30#issuecomment-754271180


   I think we can make the file even hidden because this is a technical detail. Please raise a followup PR for this.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [maven-apache-parent] michael-o commented on pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30#issuecomment-754202752


   Althouth this looks technically correct, I do think that this will not work. You have moved the property to a comment and added an enforcer rule, but with the next release the property will be added again and inherited.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [maven-apache-parent] kwin edited a comment on pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

Posted by GitBox <gi...@apache.org>.
kwin edited a comment on pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30#issuecomment-754239741


   Activate the rule only in a profile which is activated only in case a marker file with name `asf-parent.marker` is missing. That would require adding such a file (could be empty) to the maven-apache-parent repository.
   The only other option is to deal with explicitly given profiles or system properties in case asf-parent is built.
   
   I tried it out in https://github.com/kwin/maven-apache-parent/commit/aff2ed0a1c45c45465c2652e72ae7359dd41fcca and it seems to work. Should I raise a follow-up PR?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [maven-apache-parent] michael-o commented on a change in pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30#discussion_r551001869



##########
File path: pom.xml
##########
@@ -330,6 +332,13 @@ under the License.
                 <requireMavenVersion>
                   <version>3.1.1</version>
                 </requireMavenVersion>
+                <requireProperty>
+                  <property>project.build.outputTimestamp</property>
+                  <message>The property "project.build.outputTimestamp" must be set on the reactor's root pom.xml to make the build reproducible. Further information at "https://maven.apache.org/guides/mini/guide-reproducible-builds.html".</message>
+                  <!-- https://www.myintervals.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/ -->
+                  <regex>^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$</regex>

Review comment:
       This does not cover because also a seconds since epoch are allowed. Processing will happily fail when the input format is wrong: https://maven.apache.org/shared/maven-archiver/xref/org/apache/maven/archiver/MavenArchiver.html#L775. I would go with the require only.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [maven-apache-parent] kwin commented on pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

Posted by GitBox <gi...@apache.org>.
kwin commented on pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30#issuecomment-754211765


   IMHO maven-release-plugin will only update an existing property but never add it initially.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [maven-apache-parent] michael-o commented on pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30#issuecomment-754224564


   You are right: https://github.com/apache/maven-release/blob/44ff401499713c981732f3379de2cf6693e0fdef/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java#L350-L355


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [maven-apache-parent] kwin commented on pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

Posted by GitBox <gi...@apache.org>.
kwin commented on pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30#issuecomment-754239741


   Activate the rule only in a profile which is activated only in case a marker file with name `asf-parent.marker` is missing. That would require adding such a file (could be empty) to the local directory.
   The only other option is to deal with explicitly given profiles or system properties in case asf-parent is built.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [maven-apache-parent] asfgit closed pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [maven-apache-parent] michael-o commented on pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30#issuecomment-754236741


   What would be your proposal then?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [maven-apache-parent] kwin commented on pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

Posted by GitBox <gi...@apache.org>.
kwin commented on pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30#issuecomment-754815016


   I raised a follow-up PR in https://github.com/apache/maven-apache-parent/pull/33. @michael-o Please have a look.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [maven-apache-parent] kwin commented on a change in pull request #30: MPOM-255 enforce setting property "project.build.outputTimestamp"

Posted by GitBox <gi...@apache.org>.
kwin commented on a change in pull request #30:
URL: https://github.com/apache/maven-apache-parent/pull/30#discussion_r551002830



##########
File path: pom.xml
##########
@@ -330,6 +332,13 @@ under the License.
                 <requireMavenVersion>
                   <version>3.1.1</version>
                 </requireMavenVersion>
+                <requireProperty>
+                  <property>project.build.outputTimestamp</property>
+                  <message>The property "project.build.outputTimestamp" must be set on the reactor's root pom.xml to make the build reproducible. Further information at "https://maven.apache.org/guides/mini/guide-reproducible-builds.html".</message>
+                  <!-- https://www.myintervals.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/ -->
+                  <regex>^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$</regex>

Review comment:
       Done in 45d63d2.




----------------------------------------------------------------
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:
users@infra.apache.org