build-helper-maven-plugin
build-helper-maven-plugin copied to clipboard
[RFE] attach-artifact: Add a ignoreIfMissing property to Artifact
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