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'v seen this kind of dependciy but there is no explanation how to do it properly..thx in advance
There is a simple answer for that.
Add spring.version to properties section in
pom.xml
.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:
Then it will work.
${spring.version}
is a placeholder, you need to configure its actual value in<properties>
block:if you want to use ${spring.version} then first define its version in properties tag and it is good practice to use to define the version in properties tag because if we change the version then we don't need to do changes in the entire file just do change in properties tag.