Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven "versions" plugin - how to exclude alpha/beta versions from response?

I have an issue concerning the plugin versions.

When it generates a report with the goal:

mvn versions:display-dependency-updates 

It suggest is a lot of libraries that with beta or alpha versions.

 org.hibernate:hibernate-validator ......... 4.2.0.Final -> 4.3.0.Beta1 

The issue is that event if the goal of this plugin is to show the very latest versions of each dependency, I don't want to use beta/alpha versions for production code. But I don't want to search manually the last stable version neither.

I've tried the 'comparisonMethod' option: numeric, maven, etc. No success whatsoever.

Any ideas for the plugin 'versions' to show the latests available versions of dependencies, but without including beta/alpha?

like image 303
Ivan Tamayo Avatar asked Apr 19 '12 14:04

Ivan Tamayo


1 Answers

You can configure the versions plugin like this:

<plugin>     <groupId>org.codehaus.mojo</groupId>     <artifactId>versions-maven-plugin</artifactId>     <version>2.1</version>     <configuration>         <rulesUri>someUrl</rulesUri>     </configuration> </plugin> 

someUrl can also be a file URL. The syntax of the rules file is given in http://www.mojohaus.org/versions-maven-plugin/version-rules.html, it may contain something like this:

<ruleset comparisonMethod="maven"   xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 http://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">   <ignoreVersions>     <ignoreVersion type="regex">.*-beta.</ignoreVersion>     <ignoreVersion type="regex">.*_ALPHA</ignoreVersion>   </ignoreVersions> </ruleset> 
like image 129
Michael Piefel Avatar answered Oct 24 '22 07:10

Michael Piefel