elharo commented on code in PR #283:
URL: 
https://github.com/apache/maven-artifact-plugin/pull/283#discussion_r4480349820


##########
src/main/java/org/apache/maven/plugins/artifact/buildinfo/BuildInfoWriter.java:
##########
@@ -174,29 +174,33 @@ void printArtifacts(MavenProject project) throws 
MojoExecutionException {
         int n = 0;
         Artifact pomArtifact =
                 new DefaultArtifact(project.getGroupId(), 
project.getArtifactId(), null, "pom", project.getVersion());
-        if (consumerPom != null) {
-            // Maven 4 transient consumer POM attachment is published as the 
POM, overrides build POM, see
-            // 
https://github.com/apache/maven/blob/c79a7a02721f0f9fd7e202e99f60b593461ba8cc/maven-core/src/main/java/org/apache/maven/internal/transformation/ConsumerPomArtifactTransformer.java#L130-L155
-            try {
-                Path pomFile = 
Files.createTempFile(Paths.get(project.getBuild().getDirectory()), "consumer-", 
".pom");
-                Files.copy(consumerPom.getFile().toPath(), pomFile, 
StandardCopyOption.REPLACE_EXISTING);
-                pomArtifact = pomArtifact.setFile(pomFile.toFile());
-            } catch (IOException e) {
-                p.println("Error processing consumer POM: " + e);
+        Path consumerPomFile = null;
+        try {
+            if (consumerPom != null) {
+                // Maven 4 transient consumer POM attachment is published as 
the POM, overrides build POM, see
+                // 
https://github.com/apache/maven/blob/c79a7a02721f0f9fd7e202e99f60b593461ba8cc/maven-core/src/main/java/org/apache/maven/internal/transformation/ConsumerPomArtifactTransformer.java#L130-L155
+                consumerPomFile =

Review Comment:
   I think you should be able to declare this here and clean it up on this 
branch



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