How to skip Ivy publish without causing error?

久未见 提交于 2019-12-23 15:58:03

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/5234059/how-to-skip-ivy-publish-without-causing-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!