Skip to content

Remove AbstractCompilerMojo::patchJdkModuleVersion - #1149

Open
anthonyvdotbe wants to merge 3 commits into
apache:maven-compiler-plugin-3.xfrom
anthonyvdotbe:maven-compiler-plugin-3.x
Open

anthonyvdotbe wants to merge 3 commits into
apache:maven-compiler-plugin-3.xfrom
anthonyvdotbe:maven-compiler-plugin-3.x

Conversation

@anthonyvdotbe

@anthonyvdotbe anthonyvdotbe commented Oct 2, 2026 •

Copy link
Copy Markdown

Remove AbstractCompilerMojo::patchJdkModuleVersion for the reasons explained in #1148.

Fixes #1148

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

For the record, MCOMPILER-192 fails with an error that has nothing to do with this PR:

[DEBUG] Command line options:
[DEBUG] -d C:\Users\antho\Repositories\apache\maven-compiler-plugin\target\it\MCOMPILER-192\target\classes -classpath C:\Users\antho\Repositories\apache\maven-compiler-plugin\target\it\MCOMPILER-192\target\classes; -sourcepath C:\Users\antho\Repositories\apache\maven-compiler-plugin\target\it\MCOMPILER-192\src\main\java; C:\Users\antho\Repositories\apache\maven-compiler-plugin\target\it\MCOMPILER-192\src\main\java\dummy\HelloWorld.java C:\Users\antho\Repositories\apache\maven-compiler-plugin\target\it\MCOMPILER-192\src\main\java\dummy\license.txt -s C:\Users\antho\Repositories\apache\maven-compiler-plugin\target\it\MCOMPILER-192\target\generated-sources\annotations -g -target 1.8 -source 1.8 -encoding UTF-8
[DEBUG] incrementalBuildHelper#beforeRebuildExecution
[INFO] Compiling 2 source files with javac [forked debug target 1.8] to target\classes
[DEBUG] Compiler output:
error: invalid flag: C:\Users\antho\Repositories\apache\maven-compiler-plugin\target\it\MCOMPILER-192\src\main\java\dummy\license.txt
Usage: javac <options> <source files>
use --help for a list of possible options

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of patchJdkModuleVersion is well-motivated (#1148 makes a strong case). However, the PR is incomplete — it removes the call site and the private method but leaves behind orphaned artifacts that need to be cleaned up in the same PR:

  1. ModuleInfoTransformer.java — This class is now dead code with zero callers. It should be deleted.
  2. src/it/MCOMPILER-542/ — This integration test explicitly verifies the patching behavior being removed (module version rewriting + checksum validation). It will fail on CI. Either remove or adapt the IT.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after new commits (506fc27). Both findings from the previous review are now addressed:

  1. ModuleInfoTransformer.java deleted ✅ — Dead code removed, no remaining references anywhere in the tree.
  2. src/it/MCOMPILER-542/ deleted ✅ — Integration test for the removed patching behavior is gone.

The removal is clean and complete:

  • outputTimestamp field + @Parameter annotation removed (only consumer was patchJdkModuleVersion)
  • patchJdkModuleVersion private method removed
  • ModuleInfoTransformer class deleted
  • MCOMPILER-542 integration test directory deleted
  • No orphaned imports remain (ASM is still used elsewhere for module-info generation)
  • No other tests reference the removed code

Solid cleanup. Ready to merge.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants