If the addMainModuleInfo task is invoked with reproducible archive settings (see docs) then entries for module-info.class won't be reproducible.
Sample project can be found at https://github.com/aalmiray/helloworld-jpms-reproducible
Building a non reproducible archive with ./gradle build yields
$ unzip -l build/libs/helloworld-jpms-reproducible-1.0.0.jar
Archive: build/libs/helloworld-jpms-reproducible-1.0.0.jar
Length Date Time Name
--------- ---------- ----- ----
0 06-27-2023 19:31 META-INF/
46 06-27-2023 19:31 META-INF/MANIFEST.MF
0 06-27-2023 19:31 com/
0 06-27-2023 19:31 com/acme/
530 06-27-2023 19:31 com/acme/App.class
0 06-27-2023 19:31 META-INF/versions/
0 06-27-2023 19:31 META-INF/versions/11/
183 06-27-2023 19:31 META-INF/versions/11/module-info.class
--------- -------
759 8 files
Building a reproducible archive with ./gradlew build -PreproducibleBuild=true yields
$ unzip -l build/libs/helloworld-jpms-reproducible-1.0.0.jar
Archive: build/libs/helloworld-jpms-reproducible-1.0.0.jar
Length Date Time Name
--------- ---------- ----- ----
0 02-01-1980 00:00 META-INF/
46 02-01-1980 00:00 META-INF/MANIFEST.MF
0 02-01-1980 00:00 com/
0 02-01-1980 00:00 com/acme/
530 02-01-1980 00:00 com/acme/App.class
0 06-27-2023 19:31 META-INF/versions/
0 06-27-2023 19:31 META-INF/versions/11/
183 06-27-2023 19:31 META-INF/versions/11/module-info.class
--------- -------
759 8 files
Timestamp for module-info.class and its containing directories do not honor reproducible settings.
If the
addMainModuleInfotask is invoked with reproducible archive settings (see docs) then entries formodule-info.classwon't be reproducible.Sample project can be found at https://github.com/aalmiray/helloworld-jpms-reproducible
Building a non reproducible archive with
./gradle buildyieldsBuilding a reproducible archive with
./gradlew build -PreproducibleBuild=trueyieldsTimestamp for
module-info.classand its containing directories do not honor reproducible settings.