java – Usage of ${spring.version}

java – Usage of ${spring.version}

${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>

I dont 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.

java – Usage of ${spring.version}

<properties>
    <spring.version>4.3.2.RELEASE</spring.version>
    <junit.version>4.12</junit.version>
</properties>

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

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 dont need to do changes in the entire file just do change in properties tag.

Leave a Reply

Your email address will not be published. Required fields are marked *