You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2023/05/16 08:39:04 UTC

[GitHub] [maven] gnodet commented on a diff in pull request #1105: [MNG-7740] Remove old temporary consumer*pom files from buildDir

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


##########
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:
   Can we move the call to `removeOldConsumerPomFiles` before generating the new file and remove them all instead of having to pass the newly created file as an argument ?



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



-- 
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-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org