Affected version
1.2.3
Bug description
In a multi-module reactor where a downstream module depends on an upstream module, running mvn clean compile twice fails on the second invocation. The first run populates the cache. The second run gets a cache hit on the upstream, then the downstream's compile fails:
[ERROR] Failed to execute goal on project downstream: Could not resolve dependencies for project example:downstream:jar:1.0-SNAPSHOT
[ERROR] dependency: example:upstream:jar:1.0-SNAPSHOT (compile)
[ERROR] Could not find artifact example:upstream:jar:1.0-SNAPSHOT
The above can also be reproduced in other ways:
mvn clean test-compile twice
mvn clean test twice
What works:
mvn clean package twice
mvn clean verify twice
mvn clean followed by mvn compile as separate invocations
So the combination of clean plus a goal that stops before package, in a single invocation, seems to be what triggers it.
Minimal reproducer
parent/
pom.xml (packaging=pom, modules: upstream, downstream)
.mvn/
extensions.xml (declares maven-build-cache-extension 1.2.3)
maven-build-cache-config.xml (defaults)
upstream/
pom.xml
src/main/java/example/Upstream.java
downstream/
pom.xml (depends on upstream)
src/main/java/example/Downstream.java
Steps:
mvn clean compile # BUILD SUCCESS
mvn clean compile # BUILD FAILURE
Happy to attach a zip or post a gist with the full project.
Affected version
1.2.3
Bug description
In a multi-module reactor where a downstream module depends on an upstream module, running
mvn clean compiletwice fails on the second invocation. The first run populates the cache. The second run gets a cache hit on the upstream, then the downstream's compile fails:The above can also be reproduced in other ways:
mvn clean test-compiletwicemvn clean testtwiceWhat works:
mvn clean packagetwicemvn clean verifytwicemvn cleanfollowed bymvn compileas separate invocationsSo the combination of
cleanplus a goal that stops beforepackage, in a single invocation, seems to be what triggers it.Minimal reproducer
Steps:
Happy to attach a zip or post a gist with the full project.