Add interactive mode for versions:update-parent, versions:update-properties,
versions:use-latest-snapshots
----------------------------------------------------------------------------------------------------------
Key: MVERSIONS-157
URL: https://jira.codehaus.org/browse/MVERSIONS-157
Project: Maven 2.x Versions Plugin
Issue Type: New Feature
Affects Versions: 1.2
Reporter: Martin Todorov
Attachments: MVERSIONS-157.diff
As discussed last week in the IRC channel, I have implemented this
functionality and would like to propose a patch for review and ask for it to be
included in the next release (probably 1.4, since I see 1.3 is almost done,
with the exception of the integration tests...?).
I have gone through the code and done the following:
- I have added interactive mode. This is triggered by the -Dinteractive
property and is currently only used during versions:update-parent,
versions:use-latest-snapshots and versions:update-properties.
- I have refactored some of the code and extracted a couple of methods (for
example findLatestSnapshotVersion) from UseLatestSnapshotsMojo to
AbstractVersionsUpdaterMojo in order to be able to re-use it from
UpdateParentMojo as well.
- I have fixed a problem which was not initially obvious, unless you were to
use interactive mode, where it manifested itself. It consisted in the fact that
the plugin tries to replace the versions of the dependencies without caring
whether they are declared directly in the current pom, or whether they are
inherited. While this does not appear to be a grave problem at first glance,
this takes more time this way and otherwise makes the interactive mode prompt
you for versions of dependencies which you don't really need to set, as they're
already inherited. I have fixed this by comparing with the project's original
model.
- I have added a property (allowUpdatesOfExistingSnapshots) which allows you to
update the versions of dependencies which are already set to SNAPSHOT-s. This
is useful for cases where at some time in the past on a rarely touched module
you've set a SNAPSHOT version (for example 1.2-SNAPSHOT) for a dependency which
now has much newer versions (1.9-SNAPSHOT).
Unfortunately, at the moment I am not sure if and how I can provide integration
tests. I am, however, quite certain that a lot of people would also benefit
from these changes.
Therefore, I would like to contribute my changes to the plugin.
Let me know how you find the proposed patch and if I should do anything else.
--
This message is automatically generated by JIRA.
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