reda-alaoui commented on code in PR #178: URL: https://github.com/apache/maven-build-cache-extension/pull/178#discussion_r1734881627
########## src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java: ########## @@ -892,6 +892,18 @@ private void restoreGeneratedSources(Artifact artifact, Path artifactFilePath, M Files.createDirectories(outputDir); } CacheUtils.unzip(artifactFilePath, outputDir); + OutputType outputType = OutputType.fromClassifier(artifact.getClassifier()); + if (outputType != OutputType.GENERATED_SOURCE) { + return; + } + Path targetDir = Paths.get(project.getBuild().getDirectory()); + if (outputDir.equals(targetDir.resolve("generated-sources")) Review Comment: The bug fixed by this PR can emerge with https://github.com/apache/maven-build-cache-extension/pull/177 merged. If reconciliation is done like proposed in https://github.com/apache/maven-build-cache-extension/pull/177, we can have the following situation. A project uses an annotation processor to generate some java files. A cached entry exists and comes from a `verify -DskipTests`. The new build `verify` reuses this entry by skipping all plugin executions preceding `maven-surefire-plugin`. Among the skipped executions is `compiler:compile`. After the tests comes `maven-javadoc-plugin`. When `maven-javadoc-plugin`, the build fails because `maven-javadoc-plugin` is unable to find the source files of the compiled `generated-sources`. This is because `maven-javadoc-plugin` expects `maven-compiler-plugin` to have enriched the maven context with the additional source roots. But since this later was skipped by the cache, additional source roots are missing. -- 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: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org