문제

  • Let's assume my application needs foo.jar and bar.jar
  • foo.jar needs version 1.0 of c.jar
  • bar.jar needs version 2.0 of c.jar

How does Maven resolve this conflict? Which version of c.jar will be used?

도움이 되었습니까?

해결책

It depends on the order of declaration in your effective POM. If foo.jar shows up first you will get version 1.0 of c.jar. If on the other hand bar.jar is declared first it will be version 2.0 of c.jar.

Relevant documentation:

...two dependency versions are at the same depth in the dependency tree, until Maven 2.0.8 it was not defined which one would win, but since Maven 2.0.9 it's the order in the declaration that counts: the first declaration wins

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top