So I have a job in my CI app that publishes to Nexus when a change pushed to develop on an app.
Is there a way to make ./sbt publish idempotent? Because occasionally we want to run the job again because of a temporary issue, and it'll error out with:
[16:31:24]java.io.IOException: destination file exists and overwrite == false
[16:31:24] at org.apache.ivy.plugins.repository.url.URLRepository.put(URLRepository.java:75)
[16:31:24] at org.apache.ivy.plugins.repository.AbstractRepository.put(AbstractRepository.java:130)
[16:31:24] at sbt.ConvertResolver$ChecksumFriendlyURLResolver$class.put(ConvertResolver.scala:78)
[16:31:24] at sbt.ConvertResolver$PluginCapableResolver$1.put(ConvertResolver.scala:103)
[16:31:24] at org.apache.ivy.plugins.resolver.RepositoryResolver.publish(RepositoryResolver.java:216)
Because we've not bumped the version number. Right now I'm going with a hacky:
./sbt publish || true
So the job doesnt exit 1 and error in CI. Is there a better way?
You can use
isSnapshot := true
This only allows a file to be overwritten. It seems likely that this behavior may change in the future.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With