`AbstractCompilerMojo::patchJdkModuleVersion` is problematic and should be removed
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- java
- Domain
- build-system
Research direction
Start at AbstractCompilerMojo::patchJdkModuleVersion and inspect related issue #969. Trace when the method runs, how it changes module descriptors, and how outputTimestamp currently acts as a workaround. Done means the requested default behavior or explicit deactivation option is defined and covered by the relevant project tests.
Written by the indexing model from the issue text.
Description
Affected version
3.16.0
Bug description
Imho, this method is problematic and should be removed (or at least deactivatable via a specific property).
The idea is to ensure build reproducibility by overriding the version of the JDK modules in the module descriptor. However, I'd argue that building with different JDKs should not guarantee build reproducibility and that this method is thus not required at all.
The Maven guide on reproducible builds says:
A build is reproducible if given the same source code, build environment and build instructions, any party can recreate bit-by-bit identical copies of all specified artifacts.
Using different JDKs surely doesn't qualify as "the same [...] build environment", does it?
It is executed by default, which is problematic: I don't want Maven to modify my compiled code in any way, especially without explicit configuration.
Its behavior differs from that of the JDK: this method sets the version to the release version, whereas the JDK either sets it to the full version (e.g., 21.0.10) or to no version at all.
It uses ASM, which currently doesn't have a release with JDK 28 support yet, so Maven is unable to compile a modular project with a JDK 28 toolchain. (Unless you dig into the code of this plugin and realize you can set <project.build.outputTimestamp></project.build.outputTimestamp> in your POM as a workaround.)
Related: #969
- Dominant language
- Java
- Stars
- 263
- Forks
- 195
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 16
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/maven-compiler-plugin
-
3.x bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
apache/maven-compiler-plugin#1140 · 1 comment ·
Maintainers usually reply within 1 day
-
3.x enhancement
Difficulty 3/5 1-2 days Newbie friendliness 68/100
apache/maven-compiler-plugin#1138 ·
Maintainers usually reply within 1 day
-
3.x bug
Difficulty 4/5 3-5 days Newbie friendliness 64/100
apache/maven-compiler-plugin#1137 ·
Maintainers usually reply within 1 day
-
3.x bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
apache/maven-compiler-plugin#1124 · 1 comment · 3 reactions ·
Maintainers usually reply within 1 day
-
build github_actions
Difficulty 4/5 3-5 days Newbie friendliness 48/100
apache/maven-compiler-plugin#1099 ·
Maintainers usually reply within 1 day
All issues in apache/maven-compiler-plugin
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/rocketmq-dashboard#7250 ·
Maintainers usually reply within 3 days
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
ignatov/intellij-erlang#1093 ·
-
HttpMaxFrameSizeTest.sendOversizedMessageTest() passes silently when maxFrameSize is not enforcedOpen
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/activemq#2706 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
federicoiosue/Omni-Notes#1032 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
unitycatalog/unitycatalog#2025 ·
Maintainers usually reply within 4 days