有没有一种方法可以配置常春藤从分支获取依赖项,而无需编辑每个相关的依赖项? [英] Is there a way to configure Ivy to get dependencies from a branch without editing every dependency concerned?

查看:69
本文介绍了有没有一种方法可以配置常春藤从分支获取依赖项,而无需编辑每个相关的依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我这里有很多项目,这些项目彼此之间以及与外部库之间都具有依赖性。依赖管理是通过ivy和我们自己的存储库完成的。我们最近不得不分支,因为存在一个版本的质量检查项目,而另一个版本则进行了当前的开发。

I have a number of projects here that have dependencies between each other as well as to external libraries. Dependency management is done with ivy and our own repository. We recently had to branch because there is one version of the projects that is in QA and another one where current development is done.

问题在于,如果不向所有内部依赖项中添加branch属性,就无法找到在新分支中使用常春藤的方法。

The problem is that I can't find a way to use ivy in the new branch without adding the branch attribute to every internal dependency.

我考虑过将branch属性添加到resolve任务并激活内联模式,但随后它也将应用于不正确的外部库。但是将branch属性添加到每个内部dep会很麻烦。

I thought about adding the branch attribute to the resolve task and activating inline mode but then it would also apply to the external libraries which is not correct. But adding the branch attribute to every interal dep would be cumbersome.

推荐答案

因此,您要区分从分支发布的文物和从行李箱发布的人工制品?

So you want to differentiate between artefacts published from the branch and artefacts published from the trunk?

我使用常春藤 buildnumber 任务来增加每个出版物的发行号。

I use the ivy buildnumber task to increment the release number of each publication.

<ivy:buildnumber organisation="${ivy.organisation}" module="${ivy.module}" revision="${project.version}"/>

<ivy:publish pubrevision="${ivy.new.revision}" resolver="${project.resolver}"  status="${project.status}">
    <artifacts pattern="${build.dir}/dist/[artifact].[ext]"/>
</ivy:publish>

分支使用 project.version 属性来指示主干的版本它们源自的分支,例如:

Branches use a project.version property that indicates which version of the trunk branch they originate from, for example:

project.version=1.0-MYBRANCH

这种方法意味着已发布的工件具有以下修订号:

This approach means published artifacts have the following revision numbers:

1.0-MYBRANCH.0
1.0-MYBRANCH.1
1.0-MYBRANCH.2
..

主干版本为:

1.0.0
1.0.1
1.0.2
..

这篇关于有没有一种方法可以配置常春藤从分支获取依赖项,而无需编辑每个相关的依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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