Maven - Detect Multiple Versions of the Same Dependency

后端 未结 6 1102
眼角桃花
眼角桃花 2021-02-01 06:19

I just experienced a case of two direct dependencies of my maven project having two different versions of a particular transitive dependency.

In my particular case I had

6条回答
  •  既然无缘
    2021-02-01 07:13

    You can resolve the version conflict by excluding the non wanted version from the apropriate dependency. For example:

    
        org.jclouds.driver
        jclouds-sshj
        ${jclouds.version}
        
          
            com.sun.jersey
            jersey-core
          
        
    
    

    Or you add com.sun.jersey:jersey-core with the wanted version to your dependencies. Maven resolves version confilicts by supporting the dependency which is closest to the dependencies root.

提交回复
热议问题