可能得到的依赖版本之一插入一个过滤资源文件? [英] Possible to get one of dependency version to insert into a filtered resource file?
本文介绍了可能得到的依赖版本之一插入一个过滤资源文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个资源文件,由行家过滤:
I've a resource file, that is filtered by maven:
version=${project.version}
buildDate=${timestampFormatted}
buildBy=${user.name}
fileEncoding=${file.encoding}
XX_LIB_VERSION = ${project.dependency.someName.version}
我想有一个或多个依赖和版本的POM使用
有没有像任何事物的 $ {} project.dependency.someName.version?的
感谢您!
推荐答案
第一次提取所需的依赖关系的版本到一个属性(这始终是一个好主意):
First extract desired dependencies' versions into a property (which is always a good idea):
<properties>
<org.springframework.version>3.1.0.RC2</org.springframework.version>
</properties>
并在以后的使用的pom.xml
:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
一旦做到这一点,你可以在过滤资源引用属性:
Once this is done you can reference the property in filtered resource:
XX_LIB_VERSION=${org.springframework.version}
这篇关于可能得到的依赖版本之一插入一个过滤资源文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文