Ivy:强制依赖本地快照

发布于 2024-11-29 07:20:31 字数 802 浏览 2 评论 0原文

我有一个项目A,它依赖于项目B;两者都是正在积极开发的内部项目。 假设项目 A 的最新版本是 1.1.2,它依赖于项目 B 1.1.1。 现在我们正在开发项目 A 1.2.0,它依赖于也在开发中的项目 B 1.2.0。

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

Project B 1.2.0 的新集成版本由 CI 服务器推送到公共本地存储库中,因此,由于“更改”,每个人都能在发布后立即获得最新的集成版本。

假设 Bob 正在项目 A 上开发一项新功能,需要对项目 B 进行一些修改;他在本地私有存储库中发布了一个新的快照项目 B 1.2.0,并且在构建中选择了他的版本,因为它比公共存储库中的版本更新。到目前为止一切都好。

但是,如果 Alice 在项目 B 中提交了某些内容,CI 服务器会在公共存储库上推送新的 1.2.0,该版本比 Bob 本地的版本更新;现在鲍勃获得了通用版本,该版本覆盖了他的本地更改。

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

我尝试了“latest.snapshot”,但它采用集成版本(如果更新的话)。

处理这种模式的最佳方法是什么?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寄居者 2024-12-06 07:20:31

我认为您希望本地解析器处于“强制模式”。在 ivysettings.xml 中的本地解析器上设置 force="true"。

请参阅强制模式的描述: http://ant.apache .org/ivy/history/latest-milestone/settings/resolvers.html

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文