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

1

3

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.

Cincinnati answered 13/10, 2011 at 13:56 Comment(2)
Wouldn't branching be handled by your SCM? This would enable different copies of the ivy.xml file to be used... I don't think I understand your issueMotherinlaw
Ah, ok. Thx for your comment. I'll try to clarify that: The ivy files in the branch are exactly the same as in trunk. So if I publish from the branch, the artifact would just have an incremented version number and on the next resolve on the trunk this would be resolved as the latest dep for a project on trunk. So somehow I have to mark anything from the branch to be a branch dep. But I don't want to edit every ivy file in the project and modify the branch attribute just in order to throw all that away when I merge back into trunk.Infertile
T
4

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
..
Telemotor answered 14/10, 2011 at 22:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.