title: Maven is picking dependency of old version
body: <p>I am trying to integrate Maven - Spring MVC - Rest , but i am facing issue in which maven is not picking "spring-web/aop/beans/context/core"(version 4.3.12) dependency .</p>
  
  <p>Instead of spring-web/aop/beans/context/core  4.3.12.RELEASE , maven is picking "spring-web/aop/beans/context/core" 2.5.6.SEC03 dependency. because of this "org.springframework.web.bind.annotation.RequestMapping;" is not getting resolve as it is not there in spring web 2.5.6.SEC03</p>
  
  <p>Maven Version ->  apache-maven-3.5.2</p>
  
  <p><a href="https://i.stack.imgur.com/pZZa1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pZZa1.png" alt="Maven Version"></a></p>
  
  <p>Maven env variables
  <a href="https://i.stack.imgur.com/QpeGY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/QpeGY.png" alt="Maven env variables"></a></p>
  
  <p><a href="https://i.stack.imgur.com/jwy9K.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jwy9K.png" alt="Intellij Maven Dependency "></a></p>
  
  <p><a href="https://i.stack.imgur.com/uLZNp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/uLZNp.png" alt="Maven Respository Screenshot"></a></p>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;org.portal&lt;/groupId&gt;
      &lt;artifactId&gt;HumanResourcePortal&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;build&gt;
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;directory&gt;src/main/resources&lt;/directory&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
  
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.1.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;warName&gt;${project.artifactId}-${project.version}&lt;/warName&gt;
                      &lt;outputDirectory&gt;${project.basedir}/target&lt;/outputDirectory&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.6.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;filesets&gt;
                          &lt;fileset&gt;
                              &lt;directory&gt;
                                  /home/shivam/apache-tomcat-7.0.81/webapps/${project.artifactId}-${project.version}
                              &lt;/directory&gt;
                          &lt;/fileset&gt;
                          &lt;fileset&gt;
                              &lt;directory&gt;
                                  /home/shivam/apache-tomcat-7.0.81/webapps
                              &lt;/directory&gt;
                              &lt;includes&gt;
                                  &lt;include&gt;
                                      ${project.artifactId}-${project.version}.{packaging}
                                  &lt;/include&gt;
                              &lt;/includes&gt;
                         &lt;/fileset&gt;
                      &lt;/filesets&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.0.2&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;copy-resources&lt;/id&gt;
                          &lt;phase&gt;validate&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;copy-resources&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;outputDirectory&gt;/home/shivam/apache-tomcat-7.0.81/webapps&lt;/outputDirectory&gt;
                              &lt;resources&gt;
                                  &lt;resource&gt;
                                      &lt;directory&gt;${project.basedir}/target&lt;/directory&gt;
                                      &lt;includes&gt;
                                          &lt;include&gt;${project.artifactId}-${project.version}.${packaging}&lt;/include&gt;
                                          &lt;include&gt;${project.artifactId}-${project.version}&lt;/include&gt;
                                      &lt;/includes&gt;
                                  &lt;/resource&gt;
                              &lt;/resources&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;4.3.12.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;4.3.12.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-aop&lt;/artifactId&gt;
              &lt;version&gt;4.3.12.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;4.3.12.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;version&gt;4.3.12.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
              &lt;version&gt;4.3.12.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.thoughtworks.xstream&lt;/groupId&gt;
              &lt;artifactId&gt;xstream&lt;/artifactId&gt;
              &lt;version&gt;1.4.9&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-bundle&lt;/artifactId&gt;
              &lt;version&gt;1.8&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-core&lt;/artifactId&gt;
              &lt;version&gt;1.8&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
              &lt;version&gt;1.8&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-client&lt;/artifactId&gt;
              &lt;version&gt;1.8&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey.contribs&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-spring&lt;/artifactId&gt;
              &lt;version&gt;1.8&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;4.3.11.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.12&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.oracle&lt;/groupId&gt;
              &lt;artifactId&gt;ojdbc6&lt;/artifactId&gt;
              &lt;version&gt;11.1.0.7.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
              &lt;version&gt;4.3.12.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;version&gt;4.3.12.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>after Running maven dependency tree</p>
  
  <p><a href="https://i.stack.imgur.com/dABZY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dABZY.png" alt="after Running maven dependency tree"></a></p>
  
  <p>after running "mvn help:effectivePom"
  <a href="https://i.stack.imgur.com/XKsZi.png" rel="noreferrer"><img src="https://i.stack.imgur.com/XKsZi.png" alt="mvn help:effectivePom"></a></p>