We make extensive use of branches and including the branch in the version number is definitely the way to go. Merging between branches does involve resolving the version number, the person in charge of merging should know what to do.
I found that the versions plugin isn't much help when you start adding the branch name in - things like 'most recent snapshot' don't take into account the current branch as maven has no knowledge of it. Also I have written scripts that can check that the version number matches the current (git) branch - having a plugin would be nice for this kind of thing. Overall I think that maven kind of ignores the problem of branches of projects and doesn't really help at all in making the workflow easy. I would love to see some kind of acknowledgement of branches in maven but I'm probably being overly optimistic. Lindsay > -----Original Message----- > From: Ron Wheeler [mailto:[email protected]] > Sent: Tuesday, 18 January 2011 3:38 a.m. > To: [email protected] > Subject: Re: Distinguishing artifacts created on branches > > Using the branch id in the version number will make it easier to > understand the relation between the source and the binary that it > makes. > If you every want to know how developer X actually got the test to work > last month, it will be nice to be able to use the dependencies from his > project to find a POM and the rest of the sources that match up by GAV > and SCM branch id. > > Ron > > On 17/01/2011 9:02 AM, Ryan Connolly wrote: > > Using a classifier MAY be appropriate for this use case. > > On Jan 17, 2011 8:57 AM, "Lóránt Pintér"<[email protected]> > wrote: > >> Hi, > >> > >> I want to deploy alternate artifacts from my branches so that other > >> developers can depend on them. Say, I have a product called > >> > >> <groupId>com.mycompany.tool</groupId> > >> <artifactId>tool</artifactId> > >> <version>5.2-SNAPSHOT</version> > >> > >> Now, I'd like to create a branch of this one where I add a new > feature. > > And > >> this early adopter developer here wants to already build on my new > > feature, > >> even before I merge it back to trunk, so I deploy my artifacts to > Nexus. > >> Now, I obviously can't deploy them under the same GAV coordinates, > > otherwise > >> they'd overwrite the ones generated from trunk. I can think of two > > different > >> options: > >> > >> 1) Changing the version number > >> > >> <groupId>com.mycompany.tool</groupId> > >> <artifactId>tool</artifactId> > >> <version>5.2-MYBRANCH-SNAPSHOT</version> > >> > >> The good thing about this is that I can use the Versions plugin to > set > >> change the version number even in a multi-module project. The bad > thing is > >> that whenever a release happens on trunk, or when I merge the branch > back > > to > >> trunk, I get conflicts in all my POMs about the version number. > >> > >> 2) Changing the group ID > >> > >> <groupId>com.mycompany.tool.mybranch</groupId> > >> <artifactId>tool</artifactId> > >> <version>5.2-SNAPSHOT</version> > >> > >> This looks a bit better, but I can't use the versions plugin, and > updating > >> the groupId in many places in a big multi-module project is quite > >> troublesome. Also, it doesn't seem correct semantically. > >> > >> Do you have any advice on this? > >> > >> Thanks, > >> Lorant > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
