简体   繁体   English

在Maven POM文件中过滤依赖项的版本

[英]Filtering a dependency's version in a maven POM file

Is it possible to somehow include a dependency's version number in a pom's properties tag pair? 是否可以通过某种方式在pom的properties标签对中包含依赖项的版本号? I simply want to get hold of a dependency's version number. 我只想获取依赖项的版本号。 This is more or less an extension of this question: 这或多或少是这个问题的延伸:

Possible to get one of dependency version to insert into a filtered resource file? 可能获得依赖项版本之一以插入到经过筛选的资源文件中?

This is basically what I want to achieve, but I don't want to have to explicitly write down the version number of the dependency I need - ie I should be able to inherit the version number of the dependency. 这基本上是我想要实现的,但是我不想显式地写下我需要的依赖的版本号-即我应该能够继承依赖的版本号。

No. 没有。

Version is Mandatory for Dependency Management and dependency resolution. 版本对于依赖关系管理和依赖关系解决是必需的。

but can ease you by mentioning version such a way like 但可以这样提起版本来减轻您的负担

getting latest version all the time. 一直在获取最新版本。 getting version between specified range. 在指定范围之间获取版本。 etc. 等等

More info 更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM