Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing artifact org.springframework:spring-context:jar:${org.springframework-version}

Please why am I getting this error in my pom.xml file

Missing artifact org.springframework:spring-context:jar:${org.springframework-version}

xml file

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>${org.springframework-version}</version>
    <exclusions>
        <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
         </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>${org.springframework-version}</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-tx</artifactId>
    <version>${org.springframework-version}</version>
</dependency>
like image 866
Blaze Avatar asked Apr 19 '16 21:04

Blaze


Video Answer


2 Answers

What you are seeing as ${...} is called a Maven property:

Maven properties are value placeholder, like properties in Ant. Their values are accessible anywhere within a POM by using the notation ${X}, where X is the property.

In this case, Maven is trying to access the property org.springframework-version but it isn't defined, so nothing gets replaced.

You define your own Maven properties with the help of the <properties> section in the POM:

<properties>
    <org.springframework-version>4.2.5.RELEASE</org.springframework-version> <!-- wanted Spring version -->
    <hibernate.version>5.1.0.Final</hibernate.version> <!-- wanted Hibernate version -->
</properties>
like image 135
Tunaki Avatar answered Nov 15 '22 05:11

Tunaki


It is very likely you have not added the spring version number to your pom properties. Add this to your pom.

<properties>
    <org.springframework-version>4.2.5.RELEASE</org.springframework-version>
</properties>

Change the version to any version of your choice for your project.

like image 24
JonathanAmos Avatar answered Nov 15 '22 05:11

JonathanAmos