build-helper-maven-plugin icon indicating copy to clipboard operation
build-helper-maven-plugin copied to clipboard

[RFE] attach-artifact: Add a ignoreIfMissing property to Artifact

Open ceztko opened this issue 2 years ago • 0 comments

The attach-artifact is a very useful goal but it's very unforgiving if the artifact to be uploaded is missing, causing a build error ("Could not transfer artifact...No such file or directory"). In my use case the artifacts are native libs dependencies that may be missing because of partial builds (for example snapshots building native libs only for some architectures). The global skipAttach property[1] is not helpful since it's not granular, and my current workaround is creating fake 0 byte placeholders, which is quite bad semantically. A ignoreIfMissing property in the Artifact class that will tell to skip the upload for the specified file would be very useful and offer the required degree of granularity. This has also been asked in some StackOverflow posts[2][3] so it's definetely a reasonable feature to have.

[1] https://www.mojohaus.org/build-helper-maven-plugin/attach-artifact-mojo.html [2] https://stackoverflow.com/questions/59901644/avoid-attaching-maven-artifact-when-file-is-not-present [3] https://stackoverflow.com/questions/57673921/maven-ignore-a-specific-artifact-without-failing-the-build

ceztko avatar Apr 07 '22 10:04 ceztko