Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`AbstractCompilerMojo::patchJdkModuleVersion` is problematic and should be removed

Open
#1,148 2 comments 0 reactions 0 assignees View on GitHub

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

bug
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/maven-compiler-plugin

All issues in apache/maven-compiler-plugin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.