tfactor2 commented on code in PR #498:
URL: 
https://github.com/apache/maven-build-cache-extension/pull/498#discussion_r3470146933


##########
src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java:
##########
@@ -1323,13 +1335,15 @@ private Set<Path> 
collectCachedArtifactPaths(MavenProject project) {
         final org.apache.maven.artifact.Artifact projectArtifact = 
project.getArtifact();
         final Path targetDir = Paths.get(project.getBuild().getDirectory());
 
-        // 1. Main project artifact (JAR file or target/classes directory)
-        if (projectArtifact.getFile() != null && 
projectArtifact.getFile().exists()) {
+        // 1. Main project artifact (JAR/WAR/etc. file)
+        if (projectArtifact.getFile() != null && 
projectArtifact.getFile().isFile()) {
             paths.add(projectArtifact.getFile().toPath());
         }
 
-        // 2. Attached outputs from configuration (if cacheCompile enabled)
+        // 2. Compile outputs and configured attached outputs (if cacheCompile 
enabled)
         if (cacheConfig.isCacheCompile()) {
+            addExistingOutputPath(paths, 
project.getBuild().getOutputDirectory());
+            addExistingOutputPath(paths, 
project.getBuild().getTestOutputDirectory());
             List<DirName> attachedDirs = cacheConfig.getAttachedOutputs();

Review Comment:
   fixed



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