Giovds commented on code in PR #1105:
URL: https://github.com/apache/maven/pull/1105#discussion_r1195574336


##########
maven-core/src/main/java/org/apache/maven/internal/transformation/ConsumerPomArtifactTransformer.java:
##########
@@ -77,13 +80,34 @@ public void injectTransformedArtifacts(MavenProject 
project, RepositorySystemSes
                 Files.createDirectories(buildDir);
                 generatedFile = Files.createTempFile(buildDir, 
CONSUMER_POM_CLASSIFIER, "pom");
             }
+
+            removeOldConsumerPomFiles(generatedFile);

Review Comment:
   > I think it's easier to remove all files, then generate the new one...
   
   Fair point. It makes it simpler and clearer, nice catch!
   
   > Also, I think this removing _all_ matching files from the temporary 
directory is problematic. If we have two concurrent builds running, one of the 
files will be lost. This may be done only when `buildDirectory != null`.
   
   It would be a problem. I don't think we can safely delete any files in that 
case without introducing too much complexity, so the behaviour would be to just 
let the files live in the temp dir and _maybe_ get cleaned up by the OS. Some 
do and some don't.
   
   I didn't know the temp dir would/could be used as build directory (I just 
looked and the files were indeed there). Out of curiosity; when would this be 
the case?



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

Reply via email to