我是靠谱客的博主 稳重路灯,这篇文章主要介绍maven的依赖版本范围,现在分享给大家,希望可以做个参考。

maven项目中所依赖的jar包版本不是唯一特定的版本,可以使用版本范围设定

设定的规则见下表:

Range Meaning
1.0 x >= 1.0 * The default Maven meaning for 1.0 is everything (,) but with 1.0 recommended. Obviously this doesn't work for enforcing versions here, so it has been redefined as a minimum version.
(,1.0] x <= 1.0
(,1.0) x < 1.0
[1.0] x == 1.0
[1.0,) x >= 1.0
(1.0,) x > 1.0
(1.0,2.0) 1.0 < x < 2.0
[1.0,2.0] 1.0 <= x <= 2.0
(,1.0],[1.2,) x <= 1.0 or x >= 1.2. Multiple sets are comma-separated
(,1.1),(1.1,) x != 1.1

例子如下:

		<dependency>
			<groupId>org.twitter4j</groupId>
			<artifactId>twitter4j-core</artifactId>
			<version>[2.2,)</version>
		</dependency>
		<dependency>
			<groupId>org.twitter4j</groupId>
			<artifactId>twitter4j-stream</artifactId>
			<version>[2.2,)</version>
		</dependency>

标识依赖版本为>=2.2的jar包



最后

以上就是稳重路灯最近收集整理的关于maven的依赖版本范围的全部内容,更多相关maven内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(104)

评论列表共有 0 条评论

立即
投稿
返回
顶部