简体   繁体   English

常春藤:强制依赖本地快照

[英]Ivy: Forcing local snapshot for dependency

I have a Project A which depends on Project B;我有一个依赖于项目 B 的项目 A; 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.假设最新的 Project A 版本是 1.1.2,它依赖于 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.现在我们正在开发项目 A 1.2.0,它依赖于也在开发中的项目 B 1.2.0。

<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.项目 B 1.2.0 的新集成构建由 CI 服务器推送到公共本地存储库中,因此由于“更改”,每个人都可以在发布后立即获得最新的集成构建。

Say Bob is developing a new feature on Project A which requires some modifications to Project B;假设 Bob 正在项目 A 上开发一项新功能,需要对项目 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.他在他的本地私有存储库中发布了一个新的 shapshot Project B 1.2.0,并且他在构建中被选中,因为它比公共存储库中的更新。 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;但是如果 Alice 在项目 B 中提交了一些东西,CI 服务器会在 common repo 上推送一个新的 1.2.0,它比 Bob 在本地拥有的更新; now Bob gets the common version which overrides his local changes.现在 Bob 获得了覆盖他本地更改的通用版本。

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.当然,我可以使用不同的名称(以一种巧妙的方式使用属性文件,名称不必以 ivy.xml 结尾),例如 Bob 的 1.2.0_snapshot,只要 Bob 需要本地版本,然后切换回1.2.0的时候普通版就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?但是有没有办法强制使用状态为“快照”的工件(这将始终是本地构建的状态)而不是具有“集成”的工件(由 CI 服务器生成的工件将始终具有该状态)或更高?

I tried "latest.snapshot" but it takes the integration version, if more recent.我试过“latest.snapshot”,但它需要集成版本,如果更新的话。

What is the best way to deal with this pattern?处理这种模式的最佳方法是什么?

I think you want your local resolver to be in "force mode".我认为您希望您的本地解析器处于“强制模式”。 Set the force="true" on your local resolver in ivysettings.xml.在 ivysettings.xml 中的本地解析器上设置 force="true"。

See the description of force mode at:http://ant.apache.org/ivy/history/latest-milestone/settings/resolvers.html强制模式说明见:http://ant.apache.org/ivy/history/latest-milestone/settings/resolvers.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM