Ivy: Forcing local snapshot for dependency

不羁的心 提交于 2019-11-29 22:48:26

问题


I have a Project A which depends on Project B; both are internal projects in active development. Say the latest Project A release is 1.1.2 which depends on Project B 1.1.1. Now we are developing Project A 1.2.0 which depends on the Project B 1.2.0 also in development.

<dependency org="my.org" name="projectB" rev="1.2.0" transitive="true" conf="..." changing="true"/>

New intergration builds for Project B 1.2.0 are pushed by the CI server in the common local repository, so thanks to "changing" everyone gets the latest integration builds as soon as they are published.

Say Bob is developing a new feature on Project A which requires some modifications to Project B; he publishes a new shapshot Project B 1.2.0 in his local private repository and his is picked up in the build because is more recent than the one in the common repository. So far all ok.

But if Alice commits something in Project B, the CI server pushes a new 1.2.0 on common repo, which is more recent than the one Bob has locally; now Bob gets the common version which overrides his local changes.

Of course I could use different names (using property files in a clever way that name does not have to end in ivy.xml), something like 1.2.0_snapshot for Bob, as long as Bob needs the local version, and then switch back to 1.2.0 when the common version is ok. But isn't there a way to force using artifact whose status is "snapshot" (that will always be the status of local builds) over the ones which have "integration" (the ones produced by CI server will always have that status) or higher?

I tried "latest.snapshot" but it takes the integration version, if more recent.

What is the best way to deal with this pattern?


回答1:


I think you want your local resolver to be in "force mode". Set the force="true" on your local resolver in ivysettings.xml.

See the description of force mode at: http://ant.apache.org/ivy/history/latest-milestone/settings/resolvers.html



来源:https://stackoverflow.com/questions/7023302/ivy-forcing-local-snapshot-for-dependency

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