have a look at versions-maven-plugin

it may or may not be able to help you

Sent from my iPod

On 4 Oct 2008, at 02:16, "Keith Branton" <[EMAIL PROTECTED]> wrote:

I've been spending some time trying to get my head around the way
version resolution works in 2.0.9.

I'm trying to get a sense for the best way to use maven to achieve our
objectives:

1. Builds on our CI server that were working should not break unless
someone commits a change - in particular new versions of dependencies
should not be introduced to the build without a change to the pom. (I'm
actually more concerned about changes that don't break the build on CI
but cause runtime errors on our production web site due to some edge
case that was insufficiently covered with automated tests.)

2. We really don't want to have to restate the versions of every
dependency in all local pom files. We like "dry".

I've looked at the version ranges but am a little concerned about them
for a couple of reasons:

1. Closed ranges like [1.2,1.4] means modules need to be re-tested and
re-released with a new range if a dependency changes and any application
using the module needs the newer version of the dependency, say 1.5,
even if only transitively. With the hundreds of modules we have, this
would be a time-consuming task. Besides, very few 3rd party modules seem
to use ranges.

2. Open ranges like [1.2,) seem to imply a guarantee of compatibility
with ALL future releases. (And if all dependency declarations for a
module A are open ranges then the version of A that is actually included
can change over time as maven pulls in the latest one from the repo -
leading to temporally inconsistent builds)

I studied MNG-612 which seems like it goes a little way towards
addressing our issue, but the status of that ticket is unclear as it's
pretty old and none of the code has been merged back. Any info welcome.
(The MNG-612 branch looks like it introduced a bug into the scope
resolving code too as it swaps nearest and farthest under some
circumstances - and it is not clear to me that it would work with
ranges.)

I think what *we* would want would be the following rules for version
conflict resolution...

If a suggested version is specified in the local pom
   use it. Treat it as override for transitives, unless any
transitive specifies a range that is not satisfied by the suggestion -
in which case resolution should fail.
Else If any ranges are used
   select the oldest version that satisfies all the ranges.
Else
   use the newest suggested version.

The scope rules would need to stay as they are in 2.0.9

My questions:

1. Can anyone please tell me of a way to achieve this with 2.0.9 today?

2. Can 2.1 do this yet? Or is support for this functionality planned for
any 2.1 milestone?

3. Can anyone point me to discussions/documents describing what
direction the maven developers are planning for version conflict
resolution in the future?

If this is not in the works and we could contribute to maven to help
make this happen we would be willing to do so.

Thanks,

Keith.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to