I have a multipom maven proyect. In my pom root, I have a parent pom and DependencyManagement with spring dependencies.
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.company.project</groupId>
<artifactId>artifactId</artifactId>
<version>${project-version}</version>
<packaging>pom</packaging>
<!-- Parent Pom -->
<parent>
<groupId>com.company.project</groupId>
<artifactId>parent_pom</artifactId>
<version>1.0.0</version>
</parent>
<modules>
<module>artifactId-war</module>
</modules>
<properties>
<project-version>1.0.0</project-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>4.3.3.RELEASE</spring.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring.version}</version>
<type>pom</type> -->
<scope>import</scope>
</dependency>
....
In my artifactId-war, I have this pom.xml:
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.company.project</groupId>
<artifactId>artifactId-war</artifactId>
<packaging>war</packaging>
<parent>
<groupId>com.company.project</groupId>
<artifactId>artifactId</artifactId>
<version>${project-version}</version>
</parent>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
...
My problem is that in the parent pom there is an spring old version(4.1.8) and in my root pom I use 4.3.3 version with the artifact spring-framework-bom. In my dependency list proyect appears parent_pom versions. How I can give preference to the dependencies of my pom root?