您的位置:首页 > 其它

Maven 小技巧之 自动更新你的jar包

2016-03-03 00:00 357 查看
摘要: maven 自动更新最新版本

在maven中我们经常像下面这样引用一个依赖:
<dependency>
<groupId>wonderful-inc</groupId>
<artifactId>dream-library</artifactId>
<version>1.2.3</version></dependency>

我们指定了固定的版本1.2.3,如果我们想每次都引用最新版本,是否可以呢?答案是可以的,在pom文件的定义中,可以使用版本的一个范围,版本范围的写法说明如下:

(,1.0] x <= 1.0

1.0 "Soft" requirement on 1.0 (just a recommendation - helps select the correct version if it matches all ranges)

[1.0] Hard requirement on 1.0

[1.2,1.3] 1.2 <= x <= 1.3

[1.0,2.0) 1.0 <= x < 2.0

[1.5,) x >= 1.5

(,1.0],[1.2,) x <= 1.0 or x >= 1.2. Multiple sets are comma-separated

(,1.1),(1.1,) This excludes 1.1 if it is known not to work in combination with this library
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息