yeroc opened a new issue, #492:
URL: https://github.com/apache/maven-build-cache-extension/issues/492

   ### 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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to