We've been dealing with this same problem.  We ended up using the Maven
Metadata Plugin for Jenkins to list all of the versions and default to the
latest release.  Then before running the maven build, we run a groovy
script that we wrote to search through all the poms (we have a multi-module
project), and replace the versions with the correct version from the Maven
Metadata Plugin.  It seems to work pretty well.  This way it will default
to the latest release, but we can override it if desired.


On Thu, Jul 24, 2014 at 10:46 AM, Byte Flinger <byteflin...@gmail.com>
wrote:

> It's funny you mention that. I just spent the last hour trying to do the
> exact same thing.
> Its quite an annoyance that there is no simple way of telling the plugin
> to do that.
>
> You'd expect that use-latest-releases mojo would do the trick but it does
> not. It ignores snapshot dependencies and only works if the dependency is
> not snapshot.
>
> I think the only solution at the moment is to simply either write your own
> plugin or run your own modified version of the versions plugin.
> On 24 Jul 2014 18:29, "Jan Nehring" <jan.nehr...@semperlink.com> wrote:
>
>> Hello Guys,
>>
>>
>>
>> we have a problem with maven releases and maven version plugin. In
>> Jenkins we want to do releases automatically upon pressing a button. To
>> remove snapshot dependencies we want to use the maven versions plugin.
>> Suppose we have two projects A (latest release 0.0.1, latest snapshot
>> 0.0.2-SNAPSHOT) and project B with a dependency on ProjectA -
>> 0.0.2-SNAPSHOT and we want to release project B. How can we upgrade project
>> Bs dependencies to the latest available release version? The maven versions
>> plugin goal "use-releases" does not change the 0.0.2-SNAPSHOT dependency
>> because there is no 0.0.2 release version of this project.
>>
>>
>>
>> So my question is: how can we automatically remove snapshot dependencies
>> and replace them with the latest available release version in our scenario?
>>
>>
>>
>> Best regards Jan
>>
>

Reply via email to