maven-compiler-plugin icon indicating copy to clipboard operation
maven-compiler-plugin copied to clipboard

[MCOMPILER-397] Use relative paths in jpms.args to make the builds reproducible

Open jira-importer opened this issue 6 years ago • 3 comments

Emmanuel Bourg opened MCOMPILER-397 and commented

The jpms.args file generated since the version 3.7 contains absolute paths, for example here is the file generated for jaxb-core:

--add-modules
java.xml.bind
--upgrade-module-path
/home/ebourg/jaxb/jaxb-ri/core/target/endorsed

The absolute path affects the reproducibility of the builds. Someone else rebuilding the project is unlikely to have the same base path and will not get a byte identical artifact. I suggest using a relative path instead (starting at the root of the project or at the root of the module) and normalizing the path separators (such that builds on Windows and Unix generate the same file).


Affects: 3.8.1

Remote Links:

1 votes, 2 watchers

jira-importer avatar Sep 10 '19 07:09 jira-importer

Robert Scholte commented

The jpms.args was introduced because these are arguments used at compile you likely need at runtime as well. The -add-modules works well because it refers to a module name. But what about upgrade-module-path? Changing it to a relative path doesn't seem to help either. I understand the request, but if we change it, then the solution should be usable at runtime as well.

jira-importer avatar Sep 10 '19 17:09 jira-importer

Emmanuel Bourg commented

I understand the request, but if we change it, then the solution should be usable at runtime as well

I'm not sure to understand, how an absolute path from the developer computer building the artifact could have any impact at runtime on someone else system?

jira-importer avatar Jun 17 '23 12:06 jira-importer

Emmanuel Bourg commented

I've opened a PR with the patch currently applied to maven-compiler-plugin in Debian.

jira-importer avatar Jun 17 '23 13:06 jira-importer