olamy commented on code in PR #493:
URL:
https://github.com/apache/maven-build-cache-extension/pull/493#discussion_r4431003225
##########
src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java:
##########
@@ -1475,8 +1476,15 @@ private Set<Path>
collectCachedArtifactPaths(MavenProject project) {
paths.add(projectArtifact.getFile().toPath());
}
- // 2. Attached outputs from configuration (if cacheCompile enabled)
+ // 2. Compile output directory and attached outputs from configuration
(if cacheCompile enabled)
if (cacheConfig.isCacheCompile()) {
+ // The project artifact file is not set yet at the start of a
session, so step 1 misses
+ // target/classes. Stage it explicitly so the compiler cannot keep
classes compiled against
+ // a different version of an upstream module.
+ Path classesDir =
Paths.get(project.getBuild().getOutputDirectory());
+ if (Files.exists(classesDir)) {
+ paths.add(classesDir);
Review Comment:
see this PR for an IT
https://github.com/apache/maven-build-cache-extension/pull/568
--
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]