[ 
http://jira.codehaus.org/browse/MVERSIONS-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=190061#action_190061
 ] 

Eric Lewis commented on MVERSIONS-71:
-------------------------------------

I'm not sure about the form of the integration test you'd like. I'm attaching a 
simple POM project with two modules where the behavior can be shown. I also 
include the expected result of using
mvn versions:set -DnewVersion=1.2.0
on the project (after the enhancement).

Using -N sets the module's or project's version, which is fine, but I need to 
set the project's version as parent recursively in all modules.

This is the output of the current versions:set

$ mvn versions:set -DnewVersion=1.2.0
[INFO] Scanning for projects...
[INFO] Reactor build order: 
[INFO]   Unnamed - com.whatever:project-a:pom:1.2.0-SNAPSHOT
[INFO]   Unnamed - com.whatever:module-a1:pom:2.0.7-SNAPSHOT
[INFO]   Unnamed - com.whatever:module-a2:pom:3.7.1-SNAPSHOT
[INFO] Searching repository for plugin with prefix: 'versions'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - com.whatever:project-a:pom:1.2.0-SNAPSHOT
[INFO]    task-segment: [versions:set] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [versions:set {execution: default-cli}]
[INFO] Searching for local aggregator root...
[INFO] Local aggregation root: c:\jp\project-a
[INFO] Processing com.whatever:project-a
[INFO]     Updating project com.whatever:project-a
[INFO]         from version 1.2.0-SNAPSHOT to 1.2.0
[INFO] 
[INFO] Processing com.whatever:module-a1
[INFO]     Updating parent com.whatever:project-a
[INFO]         from version 1.2.0-SNAPSHOT to 1.2.0
[INFO]     Updating project com.whatever:module-a1
[INFO]         from version 2.0.7-SNAPSHOT to 1.2.0
[INFO] 
[INFO] Processing com.whatever:module-a2
[INFO]     Updating parent com.whatever:project-a
[INFO]         from version 1.2.0-SNAPSHOT to 1.2.0
[INFO]     Updating project com.whatever:module-a2
[INFO]         from version 3.7.1-SNAPSHOT to 1.2.0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Mon Sep 07 10:26:24 CEST 2009
[INFO] Final Memory: 10M/22M
[INFO] ------------------------------------------------------------------------

As you can see, the module versions are updated as well as their parent 
versions.

What I need is

$ mvn versions:set -DnewVersion=1.2.0
[INFO] Scanning for projects...
[INFO] Reactor build order: 
[INFO]   Unnamed - com.whatever:project-a:pom:1.2.0-SNAPSHOT
[INFO]   Unnamed - com.whatever:module-a1:pom:2.0.7-SNAPSHOT
[INFO]   Unnamed - com.whatever:module-a2:pom:3.7.1-SNAPSHOT
[INFO] Searching repository for plugin with prefix: 'versions'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - com.whatever:project-a:pom:1.2.0-SNAPSHOT
[INFO]    task-segment: [versions:set] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [versions:set {execution: default-cli}]
[INFO] Searching for local aggregator root...
[INFO] Local aggregation root: c:\jp\project-a
[INFO] Processing com.whatever:project-a
[INFO]     Updating project com.whatever:project-a
[INFO]         from version 1.2.0-SNAPSHOT to 1.2.0
[INFO] 
[INFO] Processing com.whatever:module-a1
[INFO]     Updating parent com.whatever:project-a
[INFO]         from version 1.2.0-SNAPSHOT to 1.2.0
[INFO] 
[INFO] Processing com.whatever:module-a2
[INFO]     Updating parent com.whatever:project-a
[INFO]         from version 1.2.0-SNAPSHOT to 1.2.0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Mon Sep 07 10:26:24 CEST 2009
[INFO] Final Memory: 10M/22M
[INFO] ------------------------------------------------------------------------



> versions:set changes both parent and module version
> ---------------------------------------------------
>
>                 Key: MVERSIONS-71
>                 URL: http://jira.codehaus.org/browse/MVERSIONS-71
>             Project: Maven 2.x Versions Plugin
>          Issue Type: Bug
>    Affects Versions: 1.0
>            Reporter: Eric Lewis
>         Attachments: example.zip, expected-result.zip
>
>
> When using verions:set, my understanding is that setting a version on a 
> project sets the version in that project and sets the same as parent version 
> in each module.
> However, it also sets the specified version into the module version.
> Imagine the following constellation:
> project A: version 1.2.0-SNAPSHOT
>    module A1: version 2.0.7-SNAPSHOT, parent is A with 1.2.0-SNAPSHOT
> Now, using versions:set -DnewVersion=1.2.0 gives me the following result:
> project A: version 1.2.0
>    module A1: version 1.2.0, parent is A with 1.2.0
> The version of the module has been altered, but it shouldn't.
> The versions plugin should have an option "ignoreModuleVersion" to prevent 
> this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to