Maven的“版本"插件-如何从响应中排除alpha/beta版本? [英] 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
这建议有很多具有beta或alpha版本的库.
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
问题是,如果此插件的目标是显示每个依赖项的最新版本,那么我就不想将beta/alpha版本用于生产代码.但是我也不想手动搜索最后一个稳定版本.
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.
我已经尝试过'comparisonMethod'选项:数字,maven等.均未成功.
I've tried the 'comparisonMethod' option: numeric, maven, etc. No success whatsoever.
关于插件版本"的任何想法都可以显示依赖项的最新可用版本,但不包括beta/alpha?
Any ideas for the plugin 'versions' to show the latests available versions of dependencies, but without including beta/alpha?
推荐答案
您可以这样配置版本插件:
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
也可以是文件URL.规则文件的语法在
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>
这篇关于Maven的“版本"插件-如何从响应中排除alpha/beta版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!