常春藤:强制本地快照依赖 [英] Ivy: Forcing local snapshot for dependency

查看:33
本文介绍了常春藤:强制本地快照依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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"/>

项目 B 1.2.0 的新集成构建由 CI 服务器推送到公共本地存储库中,因此由于更改",每个人在发布后立即获得最新的集成构建.

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.

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

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.

但是如果 Alice 在项目 B 中提交了一些东西,CI 服务器会在 common repo 上推送一个新的 1.2.0,它比 Bob 在本地的那个更新;现在 Bob 获得了覆盖他本地更改的通用版本.

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.

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

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?

我尝试过latest.snapshot",但它需要集成版本,如果更新的话.

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

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

What is the best way to deal with this pattern?

推荐答案

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

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

查看强制模式的说明:http://ant.apache.org/ivy/history/latest-milestone/settings/resolvers.html

这篇关于常春藤:强制本地快照依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆