Recompile when dependencies change - #1102
Open
wilx wants to merge 1 commit into
Open
Conversation
wilx
marked this pull request as ready for review
July 31, 2026 21:48
wilx
marked this pull request as draft
July 31, 2026 22:19
wilx
force-pushed
the
issue-1087-dependency-state
branch
from
July 31, 2026 22:42
3d01630 to
665f6cf
Compare
wilx
marked this pull request as ready for review
July 31, 2026 22:43
Persist ordered classpath and module-path dependency state between plugin invocations. Compare file metadata and stable directory fingerprints while preserving current-build timestamp detection in the same scan, so removed, reordered, relocated, and same-path replaced dependencies trigger recompilation without duplicate directory traversal. Fixes apache#1087
wilx
force-pushed
the
issue-1087-dependency-state
branch
from
July 31, 2026 23:25
665f6cf to
096cfb4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dependencies.lststate filechanged dependencyrebuild reason when dependencies are added, removed, reordered, relocated, or replaced at the same pathWhy
The 3.x incremental check only considered dependency timestamps relative to the current Maven session. It could therefore miss a dependency removed between invocations or a JAR replaced at the same path before the next invocation, leaving stale application bytecode.
The persisted comparison and the existing session-relative fallback are now consolidated. A missing baseline still detects dependencies rebuilt during the current Maven invocation, while unchanged builds no longer walk exploded dependencies once for persisted state and again for the timestamp fallback.
Validation
JAVA_HOME=/opt/jdks/latest-8 /opt/maven/latest/bin/mvn clean verify— 36 tests passedJAVA_HOME=/opt/jdks/latest-21 /opt/maven/latest/bin/mvn clean verify— 36 tests passedJAVA_HOME=/opt/jdks/latest-21 /opt/maven/latest/bin/mvn -Prun-its clean verify— 78 builds passed, 5 environment-specific skipsFixes #1087
Following this checklist to help us incorporate your
contribution quickly and easily:
[MCOMPILER-XXX]convention is not applicable because this is tracked as GitHub issue No recompilation if the dependencies have changed #1087.mvn clean verify.mvn -Prun-its clean verify.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.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.