Is there a way to configure Ivy to get dependencies from a branch without editing every dependency concerned?

[亡魂溺海] 提交于 2020-01-13 18:00:30

问题


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.

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.

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.


回答1:


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

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>

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
..

Whereas trunk releases would be:

1.0.0
1.0.1
1.0.2
..


来源:https://stackoverflow.com/questions/7755218/is-there-a-way-to-configure-ivy-to-get-dependencies-from-a-branch-without-editin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!