[
http://jira.codehaus.org/browse/MVERSIONS-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stephen Connolly closed MVERSIONS-141.
--------------------------------------
Resolution: Not A Bug
The goal is designed to update the version of the pom in the directory that you
run it from. It will scan the reactor searching for references to the old pom
version and update them.
When you run on a project that is a parent for other projects in the reactor,
it will update the parent reference, and consequently if those child projects
inherit their version from the parent project it will add those child projects
to the list of updates to apply.
There may be an issue where it also touches
<project>
<parent>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<version>1.0-SNAPSHOT</version>
...
</project>
due to how the maven model gets built. If a child project specifies it's
version explicitly like above and not relying on inheritance like
<project>
<parent>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
...
</project>
Then it's version should not be updated by updating the version of the parent.
Additionally, there is code that tries to walk up and "extend" the reactor of
projects that it considers updating... that might not be working with your
project structure.
Finally, there is the possibility to specify the groupId and artifactId of the
project you want to update, so that at the root of your aggregator you can
update the version of a specific child with
mvn versions:set -DgroupId=.... -DartifactId=.... -DoldVersion=....
-DnewVersion=....
Note you need to specify the oldVersion if it is different from the version of
the pom in which you invoke maven. The use case is where you use an older
version of a module you are building, e.g. for checking API compatibility, etc.
> mvn versions:set only updates top level pom and ignores all sub level pom.xml
> ------------------------------------------------------------------------------
>
> Key: MVERSIONS-141
> URL: http://jira.codehaus.org/browse/MVERSIONS-141
> Project: Maven 2.x Versions Plugin
> Issue Type: Bug
> Affects Versions: 1.2
> Environment: Linux, maven 2.2.1
> Reporter: Martin Jozef
>
> I have a folder structure as follows :
> root |
> |---pom.xml
> |admin |
> |---pom.xml
> | adminweb |
> |---pom.xml
> | adminear |
> |---pom.xml
> |isf |
> |---pom.xml
> |business |
> |---pom.xml
> when i run mvn versions:set -DnewVersion=11.02.00-SNAPSHOT at the root level
> only the pom.xml at the root get's updated and non of the sub-folder pom.xml
> root---pom.xml is not a parent to any of the sub-projects it's just an top
> level aggregativor for a complete build of the tree. but it does declare all
> sub project's in its <module> section.
> The other isf---pom.xml is a parent to all of it's sub-projects. So, if i
> run the command on this level it works.
> But that leaves me with dozen of other projects that i still have to go in
> one by one and run the command.
> I expected to run this command at the root and have all maven sub projects
> update it's version. Instead only the pom.xml at the root got updated.
--
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