[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2023-08-14 Thread Herve Boutemy (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17754171#comment-17754171
 ] 

Herve Boutemy commented on MJAR-275:


MJAR-295 moved to MCOMPILER-542 as it is a better place to patch 
module-info.class

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Assignee: Slawomir Jaranowski
>Priority: Minor
> Fix For: 3.3.0
>
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2023-08-07 Thread Herve Boutemy (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17751541#comment-17751541
 ] 

Herve Boutemy commented on MJAR-275:


MJAR-295 created to track this JDK patch version in module-info.class, even if 
not sure that the. workaround is best done in m-jar-p. or m-compiler-p

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Assignee: Slawomir Jaranowski
>Priority: Minor
> Fix For: 3.3.0
>
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2023-07-28 Thread Jira


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17748591#comment-17748591
 ] 

Jorge Solórzano commented on MJAR-275:
--

Please note that the fix done in [https://bugs.openjdk.org/browse/JDK-8258117] 
in the JDK 18 only partially fixes the problem, from my findings, JDK 18 does 
fix the {{module-info.class}} timestamp, BUT if the {{Main-Class}} attribute is 
set, then the {{MANIFEST.MF}} is updated without preserving the timestamp. In 
other words, this fix does not work correctly as it breaks reproducible build 
anyway in that scenario, this fix is NOT used in Maven as is not reliable.

The ACTUAL fix done in Maven uses a new feature implemented in JDK 19+ and 
backported to JDK 18.0.1+ and JDK 17.0.3+, the issue for that feature is this 
one: [https://bugs.openjdk.org/browse/JDK-8277755] , it basically leverage a 
feature to pass the --date parameter to the jar tool, plexus-archiver has 
detection if this feature exists, so it works the same in JDK 17.0.2 (which 
doesn't have the feature) and JDK 17.0.3+, and at the same time works with 
previous versions even JDK 9.

The inclusion of JDK patch version information is another topic that should be 
tackled, and yes, we should open a JDK issue for it, yet a fix for this could 
take a while and there is no real hope to get a backport for it in earlier 
versions of the JDK, so yes, we could provide a workaround here too, and I was 
hoping to work on this, but due to lack of time I wasn't able to check this, 
maybe someone could step up and work on this... my guess is that we should do 
some byte-code manipulation to remove the patch version on the post-processing 
phase, it might require using {*}_ASM_{*}, Byte Buddy or whatever to manipulate 
the _module-info.class_ and remove that field leaving it like if the 
compilation was done with a newer JDK version. Maybe someone from the ModiTect 
team could help us here.

As of today, the workaround remains to use a newer JDK version to compile the 
project using the --release.

Also, please note that this should be a new Jira issue, the timestamp is fixed 
in Maven, but the JDK patch version is not, both affect reproducible builds, 
but at the same time are not related to each other, so I propose to track the 
Patch version in another ticket and create a link that is related to this one.

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Assignee: Slawomir Jaranowski
>Priority: Minor
> Fix For: 3.3.0
>
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2023-07-28 Thread Herve Boutemy (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17748433#comment-17748433
 ] 

Herve Boutemy commented on MJAR-275:


done https://bugs.openjdk.org/browse/JDK-8258117, fixed in JDK 18

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Assignee: Slawomir Jaranowski
>Priority: Minor
> Fix For: 3.3.0
>
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2023-07-26 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17747413#comment-17747413
 ] 

Michael Osipov commented on MJAR-275:
-

I'd pursue a JDK fix first.

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Assignee: Slawomir Jaranowski
>Priority: Minor
> Fix For: 3.3.0
>
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2023-07-17 Thread Herve Boutemy (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17743645#comment-17743645
 ] 

Herve Boutemy commented on MJAR-275:


timestamp is now fixed in JDK 18 and workaround coded in Maven for earlier JDKs

for patch JDK version in module-info.class, I confirm it's not stored only if 
compiling to an earlier release: see 
https://github.com/jvm-repo-rebuild/module-info for a clear test

does anybody have a fix? or should we open a JDK issue?

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Assignee: Slawomir Jaranowski
>Priority: Minor
> Fix For: 3.3.0
>
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2022-07-03 Thread Hudson (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17562013#comment-17562013
 ] 

Hudson commented on MJAR-275:
-

Build succeeded in Jenkins: Maven » Maven TLP » maven-jar-plugin » master #19

See 
https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-jar-plugin/job/master/19/

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Assignee: Slawomir Jaranowski
>Priority: Minor
> Fix For: 3.3.0
>
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2022-06-27 Thread Jira


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17559093#comment-17559093
 ] 

Jorge Solórzano commented on MJAR-275:
--

The PR [https://github.com/apache/maven-jar-plugin/pull/43] should be ready for 
review.

This should fix the timestamp modification.

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Fix For: 3.3.0
>
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.7#820007)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2022-06-09 Thread Jira


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17552063#comment-17552063
 ] 

Jorge Solórzano commented on MJAR-275:
--

Please note that as Michael points out there are two issues here:
 # Modification of timestamps
 # Incorporation of patch JDK version information

The fix in plexus-archiver #205 only handles the first one, the timestamps, but 
when you use the same version of the JDK to compile the module declaration it 
adds the JDK patch version to the module descriptor making it non reproducible 
(unless you use the exact same JDK version).

Anyway, to overcome this limitation you can build the module descriptor 
targeting Java 9 using a newer JDK (e.g. using JDK 11 to compile a 
module-info.java with --release 9).

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Fix For: 3.3.0
>
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.7#820007)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2022-06-05 Thread Herve Boutemy (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17550177#comment-17550177
 ] 

Herve Boutemy commented on MJAR-275:


https://github.com/codehaus-plexus/plexus-archiver/pull/205 backports the fix 
for Java before 18
we need to release plexus-archiver 4.3.0 then update maven-jar-plugin to have a 
situation where the reproducibility issue will be fixed with any JDK release

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.7#820007)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2022-01-28 Thread Jira


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17483681#comment-17483681
 ] 

Ceki Gülcü commented on MJAR-275:
-

I can confirm that upgrading to Java 18 seems to have solved the 
{{module-info.class}} issue. However, now the produced  MANIFEST.MF file seems 
to be different at each build (was not the case under Java 17). I will 
investigate further later today or next week. 

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2021-12-22 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17463678#comment-17463678
 ] 

Michael Osipov commented on MJAR-275:
-

[~rfscholte], can you please add an appropriate comment to the JBS issue=

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2021-12-21 Thread Jira


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17463356#comment-17463356
 ] 

Jorge Solórzano commented on MJAR-275:
--

It's nice that this issue is fixed in Java 18, crossing my fingers for a 
backport to at least Java 17.

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2021-12-19 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17462180#comment-17462180
 ] 

Michael Osipov commented on MJAR-275:
-

I have dropped an email to the OSS liaison of Oracle for an backport. The issue 
seems to be addressed in Java 18.

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2021-04-02 Thread Anand Beh (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17313902#comment-17313902
 ] 

Anand Beh commented on MJAR-275:


I may have some good news on the inclusion of JDK patch versions. I took Jorge 
Solorzano's advice and used the --release flag, with interesting results. 
Additionally, I added JDK 16 to the analysis matrix.

 

Using JDK 11 and --release 11, the JDK version includes the patch version as 
Michael Osipov previously noted:
{code:java}
SourceFile: "module-info.java"
Module:
  #5,0// "me.a248.mjar275"
  #0
  1   // requires
#6,8000 // "java.base" ACC_MANDATED
#7  // 11.0.10
  1   // exports
#8,0// me/a248/mjar275
  0   // opens
  0   // uses
  0   // provides
{code}
 

 
{code:java}
 {code}
 

Using JDK 16 and --release 11, the JDK version vanishes:

 
{code:java}
SourceFile: "module-info.java"
Module:
  #6,0// "me.a248.mjar275"
  #0
  1   // requires
#8,8000 // "java.base" ACC_MANDATED
#0
  1   // exports
#10,0   // me/a248/mjar275
  0   // opens
  0   // uses
  0   // provides{code}
 

If you would like to reproduce these results, I have updated the reproducer to 
include module-info.hash.sh.
{code:java}
# Compiles module-info with --release 11
# Uses JDK set by environment
./module-info-hash.sh 11
{code}
Results are as follows:
|| ||JDK 11||JDK 16||
|--release 11|Patch version is present|No version present|
|--release 16|n/a|Appears that the patch version is gone, but not really, 
because JDK 16 has not had a patch release yet.|

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2021-02-27 Thread Jira


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17292126#comment-17292126
 ] 

Jorge Solórzano commented on MJAR-275:
--

Yes, the two issues are annoying, it doesn't make sense to include the JDK 
patch version here.

But I have just checked some strange behavior, it looks like if you compile 
with a Java version superior to the --release version (for instance, if you are 
using Java 11 to compile a module-info.java with --release 9), the versions are 
not recorded in the module descriptor, which in some cases could allow 
reproducible builds.

A workaround for the timestamp could still be needed on a post post-process.

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2020-12-13 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17248555#comment-17248555
 ] 

Michael Osipov commented on MJAR-275:
-

I have talked to Rory O'Donell, there are two issues:
* Modification of timestamps
* Incorporation of patch JDK version information

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2020-10-28 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1770#comment-1770
 ] 

Michael Osipov commented on MJAR-275:
-

This would require a post post-process

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2020-10-28 Thread Anand Beh (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17222196#comment-17222196
 ] 

Anand Beh commented on MJAR-275:


Ahh, I see, thank you for investigating this. It's disheartening the JDK patch 
version is written to the compiled module-info.class.

It would still be optimal to have MJAR adjust the timestamp in order to achieve 
reproducible builds on the same JDK version. For the moment projects can use 
the reproducible-build-maven-plugin which forcibly rewrites all timestamps in 
the final archive.

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2020-10-28 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17222085#comment-17222085
 ] 

Michael Osipov commented on MJAR-275:
-

Which completely breaks reproducibility. 

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2020-10-28 Thread Robert Scholte (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17222012#comment-17222012
 ] 

Robert Scholte commented on MJAR-275:
-

Up until JDK8 the jartool was just a packaging tool, plexus archiver was just 
our way to have more control. Since JDK9 the jar tool does also a lot of 
checks. Without these checks we could generate invalid modular jars, hence the 
decision to provide an archiver based on the original jar tool.

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MJAR-275|https://github.com/A248/MCOMPILER-439] 
> (Renamed from [https://github.com/A248/MCOMPILER-439])
> Source code is also provided as an attachment below



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2020-10-27 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17221765#comment-17221765
 ] 

Michael Osipov commented on MJAR-275:
-

For the sake of completeness:

Java 14:
{noformat}
$ JAVA_VERSION=14 javap -v  with-moduleinfo/target/classes/module-info.class
Classfile 
/var/osipovmi/Projekte/MCOMPILER-439/with-moduleinfo/target/classes/module-info.class
  Last modified 27.10.2020; size 217 bytes
  SHA-256 checksum 
3568d28550acaf940a86055217f3d9a9ccae9751d14f500be7bde84644827bd4
  Compiled from "module-info.java"
module me.a248.mcompiler439@0.1.0-SNAPSHOT
  minor version: 0
  major version: 55
  flags: (0x8000) ACC_MODULE
  this_class: #1  // "module-info"
  super_class: #0
  interfaces: 0, fields: 0, methods: 0, attributes: 2
Constant pool:
   #1 = Class  #2 // "module-info"
   #2 = Utf8   module-info
   #3 = Utf8   SourceFile
   #4 = Utf8   module-info.java
   #5 = Utf8   Module
   #6 = Module #7 // "me.a248.mcompiler439"
   #7 = Utf8   me.a248.mcompiler439
   #8 = Utf8   0.1.0-SNAPSHOT
   #9 = Module #10// "java.base"
  #10 = Utf8   java.base
  #11 = Utf8   14.0.2
  #12 = Package#13// me/a248/mcompiler439
  #13 = Utf8   me/a248/mcompiler439
{
}
SourceFile: "module-info.java"
Module:
  #6,0// "me.a248.mcompiler439"
  #8  // 0.1.0-SNAPSHOT
  1   // requires
#9,8000 // "java.base" ACC_MANDATED
#11 // 14.0.2
  1   // exports
#12,0   // me/a248/mcompiler439
  0   // opens
  0   // uses
  0   // provides
{noformat}

Java 11:
{noformat}
$ JAVA_VERSION=11 javap -v  with-moduleinfo/target/classes/module-info.class
Classfile 
/var/osipovmi/Projekte/MCOMPILER-439/with-moduleinfo/target/classes/module-info.class
  Last modified 27.10.2020; size 217 bytes
  MD5 checksum ab00cdf6f4aa9a49a0059c56088b1839
  Compiled from "module-info.java"
module me.a248.mcompiler439@0.1.0-SNAPSHOT
  minor version: 0
  major version: 55
  flags: (0x8000) ACC_MODULE
  this_class: #1  // "module-info"
  super_class: #0
  interfaces: 0, fields: 0, methods: 0, attributes: 2
Constant pool:
   #1 = Class  #10// "module-info"
   #2 = Utf8   SourceFile
   #3 = Utf8   module-info.java
   #4 = Utf8   Module
   #5 = Module #11// "me.a248.mcompiler439"
   #6 = Utf8   0.1.0-SNAPSHOT
   #7 = Module #12// "java.base"
   #8 = Utf8   11.0.8
   #9 = Package#13// me/a248/mcompiler439
  #10 = Utf8   module-info
  #11 = Utf8   me.a248.mcompiler439
  #12 = Utf8   java.base
  #13 = Utf8   me/a248/mcompiler439
{
}
SourceFile: "module-info.java"
Module:
  #5,0// "me.a248.mcompiler439"
  #6  // 0.1.0-SNAPSHOT
  1   // requires
#7,8000 // "java.base" ACC_MANDATED
#8  // 11.0.8
  1   // exports
#9,0// me/a248/mcompiler439
  0   // opens
  0   // uses
  0   // provides
{noformat}

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> 

[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2020-10-27 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17221760#comment-17221760
 ] 

Michael Osipov commented on MJAR-275:
-

I have even more bad news. The {{module-info.class}} is not even reproducible 
within the same major JDK version. I have produced it with 11 and 14:
{noformat}
  : cafe babe  0037 000f 0100 0b6d 6f64  ...7.mod
│  0010: 756c 652d 696e 666f 0700 0101 0010 6d6f  ule-info..mo
│  0020: 6475 6c65 2d69 6e66 6f2e 6a61 7661 0100  dule-info.java..
│  0030: 146d 652e 6132 3438 2e6d 636f 6d70 696c  .me.a248.mcompil
│  0040: 6572 3433 3913 0004 0100 0e30 2e31 2e30  er439..0.1.0
│ -0050: 2d53 4e41 5053 484f 5401 000e 4d6f 6475  -SNAPSHOT...Modu
│ -0060: 6c65 5061 636b 6167 6573 0100 146d 652f  lePackages...me/
│ -0070: 6132 3438 2f6d 636f 6d70 696c 6572 3433  a248/mcompiler43
│ -0080: 3914 0008 0100 096a 6176 612e 6261 7365  9..java.base
│ -0090: 1300 0a01 0006 3131 2e30 2e38 0100 0a53  ..11.0.8...S
│ -00a0: 6f75 7263 6546 696c 6501 0006 4d6f 6475  ourceFile...Modu
│ -00b0: 6c65 8000 0002     0003  le..
│ -00c0: 000d  0002 0003 000e  001c 0005  
│ -00d0:  0006 0001 000b 8000 000c 0001 0009  
│ -00e0:      0007  0004  
│ -00f0: 0001 0009
│ +0050: 2d53 4e41 5053 484f 5401 0014 6d65 2f61  -SNAPSHOT...me/a
│ +0060: 3234 382f 6d63 6f6d 7069 6c65 7234 3339  248/mcompiler439
│ +0070: 1400 0701 0009 6a61 7661 2e62 6173 6513  ..java.base.
│ +0080: 0009 0100 0631 342e 302e 3201 000a 536f  .14.0.2...So
│ +0090: 7572 6365 4669 6c65 0100 064d 6f64 756c  urceFile...Modul
│ +00a0: 6501 000e 4d6f 6475 6c65 5061 636b 6167  e...ModulePackag
│ +00b0: 6573 8000 0002     0003  es..
│ +00c0: 000c  0002 0003 000d  001c 0005  
│ +00d0:  0006 0001 000a 8000 000b 0001 0008  
│ +00e0:      000e  0004  
│ +00f0: 0001 0008
{noformat}

As you can see {{java.version}} is embedded into the file meaning you cannot 
reproduce with the next patch version.

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MCOMPILER-439]
> (Source code is also provided as an attachment)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2020-10-27 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17221749#comment-17221749
 ] 

Michael Osipov commented on MJAR-275:
-

Here is the problem: 
https://codehaus-plexus.github.io/plexus-archiver/xref/org/codehaus/plexus/archiver/jar/JarToolModularJarArchiver.html#L100

Don't ask why this is necessary this way.

[~rfscholte], [~hboutemy], why can't we ourselve write this information?

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MCOMPILER-439]
> (Source code is also provided as an attachment)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (MJAR-275) outputTimestamp not applied to module-info; breaks reproducible builds

2020-10-27 Thread Michael Osipov (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17221740#comment-17221740
 ] 

Michael Osipov commented on MJAR-275:
-

I can confirm the issue, but this is not a MCOMPILER issue. Ran two times and 
{{module-info.class}} had the same hash. Timestamps are wrong in JAR.

> outputTimestamp not applied to module-info; breaks reproducible builds
> --
>
> Key: MJAR-275
> URL: https://issues.apache.org/jira/browse/MJAR-275
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.0
> Environment: Mac OS X 10.14.6
> JDK 15 (build 15+36)
> JDK 11 (build 11.0.8+10)
>Reporter: Anand Beh
>Priority: Minor
> Attachments: MCOMPILER-439.zip, Screenshot 2020-10-25 at 2.35.59 
> PM.png
>
>
> Setting {{project.build.outputTimestamp}} to a fixed value allows creating 
> reproducible builds per this guide: 
> [https://maven.apache.org/guides/mini/guide-reproducible-builds.html 
> |https://maven.apache.org/guides/mini/guide-reproducible-builds.html]However, 
> if one adds a module-info file to the project, reproducible builds break.
> This is caused by module-info.class using the latest timestamp and not 
> {{project.build.outputTimestamp}}. I was able to identify the problem using 
> diffoscope: [https://diffoscope.org/.|https://diffoscope.org/] With it I 
> determined the timestamp across 2 builds was constant for all but the 
> module-info.class:
>  
> {code:java}
>   -rw 2.0 fat  862 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrder.class
> │  -rw 2.0 fat 1113 bl defN 20-Oct-17 00:40 
> space/arim/libertybans/api/select/SelectionOrderBuilder.class
> │  -rw 2.0 fat 2285 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.xml
> │  -rw 2.0 fat   74 bl defN 20-Oct-17 00:40 
> META-INF/maven/space.arim.libertybans/bans-api/pom.properties
> │ --rw 2.0 fat  557 bl defN 20-Oct-25 12:39 module-info.class
> │ +-rw 2.0 fat  557 bl defN 20-Oct-25 12:41 module-info.class
> {code}
>  
> Note the + and - which are diffoscope's way of indicating the difference 
> between the .jar files. Here the {{project.build.outputTimestamp}} is on 17 
> October. As shown, module-info has a "rebellious" timestamp.
>  
> *EDIT:*
> Example project to reproduce the bug:
> [https://github.com/A248/MCOMPILER-439]
> (Source code is also provided as an attachment)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)