Maven 2.x Release Plugin

command line versions don't seem to work on release:branch for specific format

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.1
  • Component/s: branch
  • Labels:
    None
  • Environment:
    maven 2.2.1
  • Patch Submitted:
    Yes
  • Number of attachments :
    2

Description

I have tried passing versions for certain modules to the command line while making a branch. The plugin ignores my parameters when running release:branch. It injects the defaults if I pass parameters in batch mode.

E.g. this command taken from the documentation does not work.

mvn --batch-mode release:branch -DbranchName=my-branch-1.2 -Dproject.rel.org.myCompany:projectA=1.2 \
-Dproject.dev.org.myCompany:projectA=2.0-SNAPSHOT

release:prepare supports this specific format for setting these values at command line.
Setting these values in a release.properties file e.g.
project.dev.org.myCompany\:projectA=2.0-SNAPSHOT
project.rel.org.myCompany\:projectA=1.2
works also fine.
Specifying the default at commandline works also e.g.
mvn --batch-mode release:branch -DbranchName=my-branch-1.2 -DreleaseVersion=1.2 \
-DdevelopmentVersion=2.0-SNAPSHOT

Issue Links

Activity

Hide
Lars Corneliussen added a comment - - edited

I wrote a fix. Let me know if this is good enough.. then I write some tests and submit a patch:

http://github.com/lcorneliussen/maven-release/commit/ffa24c5b98435bd8844e46a1130262051a88368f

Show
Lars Corneliussen added a comment - - edited I wrote a fix. Let me know if this is good enough.. then I write some tests and submit a patch: http://github.com/lcorneliussen/maven-release/commit/ffa24c5b98435bd8844e46a1130262051a88368f
Hide
Lars Corneliussen added a comment -

helo?

Show
Lars Corneliussen added a comment - helo?
Hide
Max Schaefer added a comment -

Seems not to work

Show
Max Schaefer added a comment - Seems not to work
Hide
Lars Corneliussen added a comment -

What doesn't work? The patch or the changes? Any error?

Show
Lars Corneliussen added a comment - What doesn't work? The patch or the changes? Any error?
Hide
Lars Corneliussen added a comment -
Show
Lars Corneliussen added a comment - I created a new patch and also included test cases. http://lcorneliussen.de/utils/git-svn/github.com/lcorneliussen/maven-release/commits/MRELEASE-524-batch-mode
Hide
Lars Corneliussen added a comment -

Based on r983489 in https://svn.apache.org/repos/asf/maven/release/trunk

Included commits:

  • MRELEASE-524 Added test cases (by Lars Corneliussen<me@lcorneliussen.de> on 09.08.2010 12:05:12)
  • MRELEASE-524 command line versions don't seem to work on release:branch for specific format\n\no In interactive mode, the user was allways asked. Now he is only asked when the user did not specify versions explicitely. The fallback-suggestions on errors now are 1.0 for release, and 1.1-SNAPSHOT for development version. (by Lars Corneliussen<me@lcorneliussen.de> on 05.05.2010 15:13:27)

View changes online: http://github.com/lcorneliussen/maven-release/compare/473197249e1caf39ee2cee6d0efc8a288c30d0c3...2e99512130cf7c224b9c9fcedfef0b96448d1934

  1. created from http://lcorneliussen.de/utils/git-svn/github.com/lcorneliussen/maven-release/commits/MRELEASE-524-batch-mode
Show
Lars Corneliussen added a comment - Based on r983489 in https://svn.apache.org/repos/asf/maven/release/trunk Included commits:
  • MRELEASE-524 Added test cases (by Lars Corneliussen<me@lcorneliussen.de> on 09.08.2010 12:05:12)
  • MRELEASE-524 command line versions don't seem to work on release:branch for specific format\n\no In interactive mode, the user was allways asked. Now he is only asked when the user did not specify versions explicitely. The fallback-suggestions on errors now are 1.0 for release, and 1.1-SNAPSHOT for development version. (by Lars Corneliussen<me@lcorneliussen.de> on 05.05.2010 15:13:27)
View changes online: http://github.com/lcorneliussen/maven-release/compare/473197249e1caf39ee2cee6d0efc8a288c30d0c3...2e99512130cf7c224b9c9fcedfef0b96448d1934
  1. created from http://lcorneliussen.de/utils/git-svn/github.com/lcorneliussen/maven-release/commits/MRELEASE-524-batch-mode
Hide
Lars Corneliussen added a comment -

Updated patch from http://lcorneliussen.de/utils/git-svn/github.com/lcorneliussen/maven-release/tree/MRELEASE-524-batch-mode

There were some runtime assertions causing test errors only when I ran the maven commandline. In IDEA the tests ran all fine.

Those assertions were never really necessary - I seem to be the first one. No tests covering them either.

http://github.com/lcorneliussen/maven-release/commit/66e5981dd944c6931face5a86a5862c1c0c73923
MRELEASE-524 removed two runtime assertions that overeagerly tried to protect the ReleaseDescripto [more...]

Show
Lars Corneliussen added a comment - Updated patch from http://lcorneliussen.de/utils/git-svn/github.com/lcorneliussen/maven-release/tree/MRELEASE-524-batch-mode There were some runtime assertions causing test errors only when I ran the maven commandline. In IDEA the tests ran all fine. Those assertions were never really necessary - I seem to be the first one. No tests covering them either. http://github.com/lcorneliussen/maven-release/commit/66e5981dd944c6931face5a86a5862c1c0c73923 MRELEASE-524 removed two runtime assertions that overeagerly tried to protect the ReleaseDescripto [more...]
Hide
Brett Porter added a comment -

patch to review

Show
Brett Porter added a comment - patch to review
Hide
Brett Porter added a comment -

I applied the patch, which went cleanly and made some improvement.

However, the command line versions still don't work - owing to no registration of the properties in the release:branch goal. I'll look at adding that.

Show
Brett Porter added a comment - I applied the patch, which went cleanly and made some improvement. However, the command line versions still don't work - owing to no registration of the properties in the release:branch goal. I'll look at adding that.
Hide
Brett Porter added a comment -

final issue resolved in r1002513.

Please take a look and see if this is what you were after

Show
Brett Porter added a comment - final issue resolved in r1002513. Please take a look and see if this is what you were after
Hide
Christoph Kutzinski added a comment -

Thanks, seems to work now.

However, the documentation on http://maven.apache.org/plugins/maven-release-plugin/examples/branch.html is a little bit misleading as it doesn't mention the updateBranchVersions parameter which you have to use. Otherwise the .rel parameters will have no effect.
I.e.
mvn --batch-mode release:branch -DbranchName=my-branch-1.2 -Dproject.rel.org.myCompany:projectA=1.2 \
-Dproject.dev.org.myCompany:projectA=2.0-SNAPSHOT

should read:
mvn --batch-mode release:branch -DupdateBranchVersions=true -DbranchName=my-branch-1.2 -Dproject.rel.org.myCompany:projectA=1.2 \
-Dproject.dev.org.myCompany:projectA=2.0-SNAPSHOT

Show
Christoph Kutzinski added a comment - Thanks, seems to work now. However, the documentation on http://maven.apache.org/plugins/maven-release-plugin/examples/branch.html is a little bit misleading as it doesn't mention the updateBranchVersions parameter which you have to use. Otherwise the .rel parameters will have no effect. I.e. mvn --batch-mode release:branch -DbranchName=my-branch-1.2 -Dproject.rel.org.myCompany:projectA=1.2 \ -Dproject.dev.org.myCompany:projectA=2.0-SNAPSHOT should read: mvn --batch-mode release:branch -DupdateBranchVersions=true -DbranchName=my-branch-1.2 -Dproject.rel.org.myCompany:projectA=1.2 \ -Dproject.dev.org.myCompany:projectA=2.0-SNAPSHOT
Hide
Christoph Kutzinski added a comment -

BTW: is it also possible to specify the versions in a release.properties file or can they only be passed as command line parameters?

Show
Christoph Kutzinski added a comment - BTW: is it also possible to specify the versions in a release.properties file or can they only be passed as command line parameters?

People

Vote (3)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: