Why order of Maven dependencies matter?

The order of dependencies does matter because of how Maven resolves transitive dependencies, starting with version 2.0.9. Excerpt from the documentation:

(…) this determines what version of a dependency will be used when multiple versions of an artifact are encountered. (…) You can always guarantee a version by declaring it explicitly in your project’s POM. (…) since Maven 2.0.9 it’s the order in the declaration that counts: the first declaration wins.

Leave a Comment