RE: Maven Release Plugin - release:branch: branch versions not set as expected

2014-09-01 Thread Mark Gibson
Ok, thanks Robert.

Sadly this doesn't fit my expectations or needs.  I'll look to do something a 
little more manual.

Mark

-Original Message-
From: Robert Scholte [mailto:rfscho...@apache.org] 
Sent: 29 August 2014 17:51
To: Maven Users List
Subject: Re: Maven Release Plugin - release:branch: branch versions not set as 
expected

Hi,

IMO branches are mutable, so it makes sense that this will always result in a 
-SNAPSHOT Only tags are considered immutable, so that will get a NON Snapshot.
IIRC only the versions of one of the poms will be updated, either the one 
staying on the trunk or the one moved to the branch.

thanks,
Robert

Op Fri, 29 Aug 2014 17:08:14 +0200 schreef Mark Gibson
:

> (please see bottom of email for environment/version information)
>
> I am trying to use the "release:branch" goal to create a branch, setting  
> the version in the POMs in both the new branch and the working copies.   
> No matter what properties I define on the command line, the release 
> plugin is overriding the branch version information to what it thinks 
> (incorrectly in my opinion) it should be.  It looks like the release 
> version is being set either by calculation from current project 
> version, or supplied development version.
>
> I.e.  when calling Maven with the following (snippet)
>
> -DreleaseVersion=1.0.0
> -DdevelopmentVersion=1.0.1-SNAPSHOT
> -DupdateVersionsToSnapshot=false
> -DdryRun=true
>
> The version in all the pom.xml.next files is as expected 
> (1.0.1-SNAPSHOT), but the version in all the pom.xml.branch files is 
> not as expected (1.0.1-SNAPSHOT when I would expect 1.0.0).
>
> Am I missing something that would explain why the above is correct?  
> Or am I missing something obvious in how to configure the plugin to 
> work as expected?
>
> (I've included a very simple repro in the grey breakout box below )
>
> Thanks
> Mark
>
>
>
> Very simple setup to demonstrate:
>
> Project structure
>
> |   pom.xml
> |
> +---child-one
> |   pom.xml
> |
> \---child-two
> pom.xml
>
> Root pom.xml
>
> http://maven.apache.org/POM/4.0.0";  
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";  
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>
>   4.0.0
>
>   org.gibbo
>   gibbo-pom
>   1.0-SNAPSHOT
>   pom
>   Gibbo Parent POM
>
>
>   
> child-one
> child-two
>   
>
>
>   
> UTF-8
>   
>
>
>   
> 
>   scm:git:ssh://g...@bitbucket.org/mwgibson/gibbo.git
> 
> 
>   scm:git:ssh://g...@bitbucket.org/mwgibson/gibbo.git
> 
> 
>   https://bitbucket.org/mwgibson/gibbo
> 
>   
>
>
>   
> 
>
>   
> org.apache.maven.plugins
> maven-scm-plugin
> 1.9.1
>   
>
>   
> org.apache.maven.plugins
> maven-release-plugin
> 2.5
>   
>
> 
>   
>
> 
>
> child-one pom.xml
>
> http://maven.apache.org/POM/4.0.0";  
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";  
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>
>   4.0.0
>
>   
> org.gibbo
> gibbo-pom
> 1.0-SNAPSHOT
> ../pom.xml
>   
>
>   child-one
>   pom
>   Gibbo Child One POM
>
> 
>
> child-two pom.xml
>
> http://maven.apache.org/POM/4.0.0";  
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";  
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>
>   4.0.0
>
>   
>org.gibbo
> gibbo-pom
> 1.0-SNAPSHOT
> ../pom.xml
>   
>
>   child-two
>   pom
>   Gibbo Child Two POM
>
> 
>
> Command Line
>
> mvn --batch-mode ^
> release:branch ^
> -DautoVersionSubmodules=true ^
> -DupdateBranchVersions=true ^
> -DupdateWorkingCopyVersions=true ^
> -DupdateDependencies=true ^
> -DupdateVersionsToSnapshot=false ^
> -DpushChanges=false ^
> -DremoteTagging=false ^
> -DsuppressCommitBeforeBranch=false ^
> -DbranchName=RELEASE-%1 ^
> -DreleaseVersion=%1 ^
> -DdevelopmentVersion=%2-SNAPSHOT ^
> -DdryRun=true
>
> I've tried specifying all modules independently (with the 
> -Dproject.rel.org.gibbo:child-one etc pattern), but the release 
> versions in the branch are still overridden incorrectly.
>
>
>
>
> mvn --version
> Apache Maven 3.2.2 (45f7c06d68e745d05

Maven Release Plugin - release:branch: branch versions not set as expected

2014-08-29 Thread Mark Gibson
(please see bottom of email for environment/version information)

I am trying to use the "release:branch" goal to create a branch, setting the 
version in the POMs in both the new branch and the working copies.  No matter 
what properties I define on the command line, the release plugin is overriding 
the branch version information to what it thinks (incorrectly in my opinion) it 
should be.  It looks like the release version is being set either by 
calculation from current project version, or supplied development version.

I.e.  when calling Maven with the following (snippet)

-DreleaseVersion=1.0.0
-DdevelopmentVersion=1.0.1-SNAPSHOT
-DupdateVersionsToSnapshot=false
-DdryRun=true

The version in all the pom.xml.next files is as expected (1.0.1-SNAPSHOT), but 
the version in all the pom.xml.branch files is not as expected (1.0.1-SNAPSHOT 
when I would expect 1.0.0).

Am I missing something that would explain why the above is correct?  Or am I 
missing something obvious in how to configure the plugin to work as expected?

(I've included a very simple repro in the grey breakout box below )

Thanks
Mark



Very simple setup to demonstrate:

Project structure

|   pom.xml
|
+---child-one
|   pom.xml
|
\---child-two
pom.xml

Root pom.xml

http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>

  4.0.0

  org.gibbo
  gibbo-pom
  1.0-SNAPSHOT
  pom
  Gibbo Parent POM


  
child-one
child-two
  


  
UTF-8
  


  

  scm:git:ssh://g...@bitbucket.org/mwgibson/gibbo.git


  scm:git:ssh://g...@bitbucket.org/mwgibson/gibbo.git


  https://bitbucket.org/mwgibson/gibbo

  


  


  
org.apache.maven.plugins
maven-scm-plugin
1.9.1
  

  
org.apache.maven.plugins
maven-release-plugin
2.5
  


  



child-one pom.xml

http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>

  4.0.0

  
org.gibbo
gibbo-pom
1.0-SNAPSHOT
../pom.xml
  

  child-one
  pom
  Gibbo Child One POM



child-two pom.xml

http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>

  4.0.0

  
   org.gibbo
gibbo-pom
1.0-SNAPSHOT
../pom.xml
  

  child-two
  pom
  Gibbo Child Two POM



Command Line

mvn --batch-mode ^
release:branch ^
-DautoVersionSubmodules=true ^
-DupdateBranchVersions=true ^
-DupdateWorkingCopyVersions=true ^
-DupdateDependencies=true ^
-DupdateVersionsToSnapshot=false ^
-DpushChanges=false ^
-DremoteTagging=false ^
-DsuppressCommitBeforeBranch=false ^
-DbranchName=RELEASE-%1 ^
-DreleaseVersion=%1 ^
-DdevelopmentVersion=%2-SNAPSHOT ^
-DdryRun=true

I've tried specifying all modules independently (with the 
-Dproject.rel.org.gibbo:child-one etc pattern), but the release versions in the 
branch are still overridden incorrectly.




mvn --version
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 
2014-06-17T14:51:42+01:00)
Maven home: C:\MyProgramFiles\apache-maven-3.2.2\bin\..
Java version: 1.7.0_60, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_60\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 8", version: "6.2", arch: "amd64", family: "windows"

git --version
git version 1.9.4.msysgit.1

Maven-release-plugin 2.5
Maven-scm-plugin 1.9.1