Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Usage of '${spring.version}'

Tags:

When I use:

<dependency>     <groupId>org.springframework</groupId>     <artifactId>spring-context</artifactId>     <version>${spring.version}</version> </dependency> 

on the console I get the following error message:

'dependencies.dependency.version' for org.springframework:spring-context:jar must be a valid version but is '${spring.version}'. @ line 40, column 19

Do I have to do a manually configuration of Maven? I've seen this kind of dependency but there is no explanation how to do it properly.

like image 642
Roni Avatar asked Mar 04 '11 17:03

Roni


2 Answers

${spring.version} is a placeholder, you need to configure its actual value in <properties> block:

<properties>     <spring.version>3.0.5.RELEASE</spring.version> </properties> 
like image 163
axtavt Avatar answered Oct 20 '22 20:10

axtavt


I don't really agree with the first answer.

Using ${spring.version} is a convenient way to config version.

In xml file, you need to set property like follow:

<properties>     <spring.version>4.3.3.RELEASE</spring.version> </properties> 

Then it will work.

like image 33
chile Avatar answered Oct 20 '22 20:10

chile