You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Frédéric Conrotte <Fr...@victorbuckservices.com> on 2011/06/20 17:59:57 UTC

With the maven-release-plugin, how to branch a module and its children ?

Hello

Say you have a module named "parent" which has 2 childs "childA" and "ChildB"

If I run 
mvn release:branch -DbranchName=my-branch
in the "parent" folder, it will branch the parent module code to SVN /branches/my-branch WITHOUT the 2 child modules.

I would like release:branch to branch the parent module and all its children to 
. /branches/my-branch/parent
. /branches/my-branch/childA
. /branches/my-branch/childB

I didn't found any solution in the doc yet:
. http://maven.apache.org/plugins/maven-release-plugin/branch-mojo.html
. http://maven.apache.org/plugins/maven-release-plugin/examples/branch.html

Is it feasible ? Or do I have to run the command for every module I want to branch ?

Any help would be appreciated, thanks

Fred

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: With the maven-release-plugin, how to branch a module and its children ?

Posted by Nick Stolwijk <ni...@gmail.com>.
I guess you could make an aggregator pom in your trunk/ which kicks of
all 3 builds. If you branch this pom it would succeed.

Or you could move your parent pom one level higher and let it serve as
parent and aggregator pom.

Hth,

Nick Stolwijk
~Senior Java Developer~

iPROFS
Wagenweg 208
2012 NM Haarlem
T +31 23 547 6369
F +31 23 547 6370
I www.iprofs.nl



2011/6/20 Frédéric Conrotte <Fr...@victorbuckservices.com>:
> Hello
>
> Say you have a module named "parent" which has 2 childs "childA" and "ChildB"
>
> If I run
> mvn release:branch -DbranchName=my-branch
> in the "parent" folder, it will branch the parent module code to SVN /branches/my-branch WITHOUT the 2 child modules.
>
> I would like release:branch to branch the parent module and all its children to
> . /branches/my-branch/parent
> . /branches/my-branch/childA
> . /branches/my-branch/childB
>
> I didn't found any solution in the doc yet:
> . http://maven.apache.org/plugins/maven-release-plugin/branch-mojo.html
> . http://maven.apache.org/plugins/maven-release-plugin/examples/branch.html
>
> Is it feasible ? Or do I have to run the command for every module I want to branch ?
>
> Any help would be appreciated, thanks
>
> Fred
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: With the maven-release-plugin, how to branch a module and its children ?

Posted by Frédéric Conrotte <Fr...@victorbuckservices.com>.
Hello

Indeed, if the modules are structured hierarchically it works:

/trunk/parent
/trunk/parent/childA
/trunk/parent/childB

but you *must* ensure that SCM parameters are 100% correct.

i.e.: 

/trunk/parent/pom.xml

	<scm>
		<connection>scm:svn:https://svnserver:18080/svn/trunk</connection>
		<developerConnection>scm:svn:https://svnserver:18080/svn/trunk</developerConnection>
		<url>https://svnserver:18080/viewvc/trunk</url>
	</scm>

/trunk/parent/childA/pom.xml

	<scm>
		<connection>scm:svn:https://svnserver:18080/svn/trunk/childA</connection>
		<developerConnection>scm:svn:https://svnserver:18080/svn/trunk/childA</developerConnection>
		<url>https://svnserver:18080/viewvc/trunk/childA</url>
	</scm>

/trunk/parent/childB/pom.xml

	<scm>
		<connection>scm:svn:https://svnserver:18080/svn/trunk/childB</connection>
		<developerConnection>scm:svn:https://svnserver:18080/svn/trunk/childB</developerConnection>
		<url>https://svnserver:18080/viewvc/trunk/childB</url>
	</scm>

Then when you run the following command:
mvn release:branch -DbranchName=<branch name> -DupdateBranchVersions=true -DupdateWorkingCopyVersions=true -DreleaseVersion=<releaseVersion> -DdevelopmentVersion=<developmentVersion>

All modules are correctly branched to /branches/<branch name> with all versions and SCM properties automatically updated

Thank you for your tips.

Frederic


-----Original Message-----
From: Barrie Treloar [mailto:baerrach@gmail.com] 
Sent: Tuesday, June 21, 2011 1:33 AM
To: Maven Users List
Subject: Re: With the maven-release-plugin, how to branch a module and its children ?

2011/6/21 Frédéric Conrotte <Fr...@victorbuckservices.com>:
> Hello
>
> Say you have a module named "parent" which has 2 childs "childA" and "ChildB"
>
> If I run
> mvn release:branch -DbranchName=my-branch
> in the "parent" folder, it will branch the parent module code to SVN /branches/my-branch WITHOUT the 2 child modules.
>
> I would like release:branch to branch the parent module and all its children to
> . /branches/my-branch/parent
> . /branches/my-branch/childA
> . /branches/my-branch/childB
>
> I didn't found any solution in the doc yet:
> . http://maven.apache.org/plugins/maven-release-plugin/branch-mojo.html
> . http://maven.apache.org/plugins/maven-release-plugin/examples/branch.html
>
> Is it feasible ? Or do I have to run the command for every module I want to branch ?
>
> Any help would be appreciated, thanks

We run the branch command manually.
I've never tried getting the release plugin to do this for us.

And as Nick suggests, move your parent one directory higher.
While Maven allows a Flat structure, there are lots of hidden gotchas
because a Hierarchy is really implied internally.
Perhaps you are running into one of these.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: With the maven-release-plugin, how to branch a module and its children ?

Posted by Barrie Treloar <ba...@gmail.com>.
2011/6/21 Frédéric Conrotte <Fr...@victorbuckservices.com>:
> Hello
>
> Say you have a module named "parent" which has 2 childs "childA" and "ChildB"
>
> If I run
> mvn release:branch -DbranchName=my-branch
> in the "parent" folder, it will branch the parent module code to SVN /branches/my-branch WITHOUT the 2 child modules.
>
> I would like release:branch to branch the parent module and all its children to
> . /branches/my-branch/parent
> . /branches/my-branch/childA
> . /branches/my-branch/childB
>
> I didn't found any solution in the doc yet:
> . http://maven.apache.org/plugins/maven-release-plugin/branch-mojo.html
> . http://maven.apache.org/plugins/maven-release-plugin/examples/branch.html
>
> Is it feasible ? Or do I have to run the command for every module I want to branch ?
>
> Any help would be appreciated, thanks

We run the branch command manually.
I've never tried getting the release plugin to do this for us.

And as Nick suggests, move your parent one directory higher.
While Maven allows a Flat structure, there are lots of hidden gotchas
because a Hierarchy is really implied internally.
Perhaps you are running into one of these.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org