解决常春藤依赖版本秩序 [英] Resolve Ivy dependency version order

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

问题描述

在我的生成神器库,我已经构建从两个分支和树干。

In my build artifact repository, I have builds from both a branch and a trunk.

我已经测试过了我的决心工程的分支,抓住正确的项目。

I have tested that my resolve works to the branch, and grabs the correct item.

但如果依赖也是在树干回购这不起作用。在这种情况下,从抓住树干,而不是我的分支的依赖。

But this doesn't work if the dependency is also in the trunk repo. In this case it grabs the dependency from the trunk and not my branch.

我需要解决拉从主干回购的依赖,如果它不是在分行,但如果依赖是在分支,我需要的分支版本,而不是主干版本。

I need resolve to pull a dependency from the trunk repo if it's not in the branch, but if the dependency is in the branch, I need the branch version, not the trunk version.

我怎样才能做到这一点艾维?我想preFER它只要找到分支版本,然后停止寻找它。这样,如果它是从分支缺少的,它的主干版本穿越瀑布。

How can I do this in Ivy? I'd prefer it to just find the branch version, then stop looking for it. That way if it's missing from the branch, it "falls through" to the trunk version.

是否有可能我使用的版本号的方式不正确,造成这种情况?

Is it possible the way I am using build numbers is incorrect for this situation?

下面是一个例子:

trunkbuild - 版本=1.0.4
branchbuild - 版本=1.0快照

trunkbuild - version = "1.0.4" branchbuild - version = "1.0-SNAPSHOT"

如果我的树枝是1.1快照呢?

Should my branches be "1.1-SNAPSHOT" instead?

在我的分支中的code应该永远是一个版本的未来,没有背后的树干。

The code in my branches should always be a version AHEAD, not behind the trunk.

推荐答案

我认为这是动态的修改就是你要找的内容:

I think it's dynamic revisions is what you're looking for:

<dependency org="mygroup" name="myartifact" revision="latest.release"/>
<dependency org="mygroup" name="myartifact" revision="latest.integration"/>

Maven仓库支持两种基本类型库的:

Maven repositories supports two basic types of repository:


  • 发布

  • 快照

只有建立在我的树干分支构件发布到发行库。

Only artifacts built on my trunk branch are published to the Release repository.

因此​​,为了得到它的工作,用latest.integration解决在快照回购文物下面的常春藤解析程序安装应该够了。

So the following ivy resolver setup should be enough to get it working, with "latest.integration" resolving to artifacts in the snapshots repo.

<ivysettings>
    <settings defaultResolver="default"/>
    <resolvers>
        <chain name="default">
            <ibiblio name="nexus-central" root="http://myhost/nexus/content/repositories/central" m2compatible="true"/>
            <ibiblio name="nexus-releases" root="http://myhost/nexus/content/repositories/releases" m2compatible="true"/>
            <ibiblio name="nexus-snapshots" root="http://myhost/nexus/content/repositories/snapshots" m2compatible="true"/>
        </chain>
    </resolvers>
</ivysettings>

注意:

您可以在你的仓库管理器中创建一个存储库组并简化常春藤设置到一个URL。

You could create a repository group within your repository manager and simplify the ivy setup to a single URL.

这篇关于解决常春藤依赖版本秩序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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