elharo opened a new issue, #245:
URL: https://github.com/apache/maven-artifact-plugin/issues/245

   Two issues with the temporary consumer-POM handling in 
`BuildInfoWriter.printArtifacts()` (lines 180-189) and 
`DescribeBuildOutputMojo.describeBuildOutput()` (lines 154-165):
   
   1. On copy failure `BuildInfoWriter` only prints `"Error processing consumer 
POM: " + e` to the buildinfo and continues (line 185), but `pomArtifact` has 
already been re-pointed at the temp file (line 183). The subsequent 
`printFile(...)` then fails with the generic "Error processing file ..." from a 
nonexistent path, masking the real cause.
   
   2. `Files.createTempFile(...)` files are never cleaned up, so every run with 
Maven 4 transient consumer POMs leaves orphan `consumer-*.pom` files in the 
project build directory.
   
   Suggested fix: throw `MojoExecutionException` (or record a real error) on 
copy failure instead of printing and continuing, and delete the temp file when 
done (`try/finally` or `Files.deleteIfExists`).


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