Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,148 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java
Ambito
build-system

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Java
Stelle
263
Fork
195
Merge medio
1g 4h
PR unite (30g)
16

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/maven-compiler-plugin

Tutte le issue di apache/maven-compiler-plugin

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.