Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deal with "omitted for conflict with.." message in pom.xml?

I have this situation:

enter image description here

I know that "Maven resolves version conflicts with a nearest-wins strategy". So here wins the aop 3.0.7 based on this rule. But i also define a dependencyManagement section in my pom and it seems like this:

    <properties>
        <org.springframework.version>3.2.4.RELEASE</org.springframework.version>
        <org.springframework.security.version>3.1.4.RELEASE</org.springframework.security.version>
    </properties>
    
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.springframework</groupId>
                <artifactId>spring-aop</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

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

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

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

        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.7.1</version>
        </dependency>

    </dependencies>

</project>

And this is what it all looks like on the dependencies tab:

enter image description here

So i expect the spring-aop to use the 3.2.4.RELEASE version instead of 3.0.7 like the webmvc, as i define this in the dependeny management.. Why is there still being used the older version 3.0.7?

like image 756
akcasoy Avatar asked Oct 26 '13 22:10

akcasoy


1 Answers

Your dependency management declaration has a typo (com.springframework instead of org.springframework).

This is the correct pom entry:

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-aop</artifactId>
  <version>3.2.4.RELEASE</version>
</dependency>

Unfortunately, since the dependency is not being used, Maven (or Eclipse) will not flag as a missing artifact.

like image 72
Boj Avatar answered Sep 17 '22 15:09

Boj