Gareth Western-3 wrote: > > What exactly is the branch attribute used for in the info tag in an > ivy descriptor? > > In our development environment we have multiple modules and will soon > be dealing with multiple branches, so it is important that the modules > grab the intra-module dependencies for the right branches. Is it as > simple as specifying the correct branch in this attribute, or would it > be better to rename each module's revision to include the branch name? > > Thanks, > > Gareth > > We've used the branch attribute quite a lot. Here's some thoughts. First of all, if you use branches in your SCM system (such as Subversion, CVS, etc), I think that when you publish your Ivy module, you should set the branch attribute. Simply set there the branch where the module came from. If it's the main branch, set it to "trunk" or "HEAD" or whatever. You may find it useful later, and if you don't ever need it, well, just don't use it. About the revisions, if you use branches, you probably should set your revision numbers so that releases don't have the same revision number. For example, if you have branches "trunk" and "RELEASE_1", you shouldn't have revision 1.1 in both of these branches. If you use [branch] in your repository pattern, it's basically possible to publish 1.1 in both branches, but it's not a good idea because of some issues. One way to make sure the revisions are always different is to use the branch name in the revision. Another way is to figure out some other model for revision numbers, such as having versions 1.1, 1.2, 1.3, etc, in the main branch and versions 1.1.1, 1.1.2, 1.1.3, etc, in the release branch. After you're publishing your modules with the branch attribute, you can use the branch attribute while using dependencies. For instance, if you have module A depending on module B, you can get the latest B from branch RELEASE_1 with this dependency in the ivy.xml of module A: If you don't put the branch attribute in the dependency, it will either get the latest from the default branch or the latest spanning branches... actually I think this will depend a bit on how you've set the repository and your latest resolvers. One way we use this feature is that we branch several tightly coupled modules in a release branch such as RELEASE_1 and then these intercoupled modules in the release refer to each other with the branch attribute. When we make a fix in one of the modules in the release branch, the depending modules in the release branch automatically get that version. At the same time, new development changes in the main branch won't flow to the release branch. So to sum it up, by using latest.* revisions and branch attributes together in the dependencies element, you can control from which branch to get your dependencies in a quite elegant way. The branching patterns you use is a matter which is behind Ivy's scope. -- View this message in context: http://old.nabble.com/Use-of-the-%22branch%22-attribute-with-%22info%22-tag-tp26058454p26128862.html Sent from the ivy-user mailing list archive at Nabble.com.