Reputation: 7687
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}
I would like to have one or more dependency and version used by the pom Is there any thing like ${project.dependency.someName.version}?
Thank you!
Upvotes: 0
Views: 104
Reputation: 340903
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>
And use it later in 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}
Upvotes: 2