开发者

How to skip Ivy publish without causing error?

I would like to skip publishing an artifact if it already exists in the repository, but as far as I can see from the documentation there isn't a way to do this. There is an overwrite attribute, but if set to false that causes the publish to fail if the artifact exists. I definitely don't want to overwrite the artifact, either.

I've looked into using <ivy开发者_如何学编程:info> and <ivy:findrevision> to see if the artifact exists and set a property I can use on my publish target (as an unless attribute, for example), but neither of these tasks allows me to specify the repository to check.

I'd rather not resort to using an external taskdef, like antcontrib's try/catch tasks.

Does anyone have any other suggestions?


Info and findrevision allow the settingsRef-attribute. So you could use an extra settings-file that only references the resolver you need (via ivy:settings and ivy:configure) and use that settingsRef in your task.


Why would you run the "publish" task if you don't intend saving what you built?

I use the buildnumber task to ensure that my version number is incremented automatically based on what was previously published.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜