

If two dependency versions are at the same depth in the dependency tree, the first declared dependency will be used.ĭirectly specify the versions of artifacts to be used when they are encountered in transitive dependencies.

Sr.No.ĭetermines what version of a dependency is to be used when multiple versions of an artifact are encountered.

Maven provides few features to control extent of transitive dependencies. Cases can arise when there are duplicate libraries. With transitive dependencies, the graph of included libraries can quickly grow to a large extent. We only need to define direct dependency in each project pom. Maven does so by reading project files (pom.xml) of dependencies, figure out their dependencies and so on. Maven helps to avoid such requirements to discover all the libraries required. In case another project C wants to use A, then that project requires to use library B too. It is pretty often a case, when a library, say A, depends upon other library, say B. Maven provides a high degree of control to manage such scenarios. Managing dependencies is a difficult task once we've to deal with multi-module projects (consisting of hundreds of modules/sub-projects). One of the core features of Maven is Dependency Management.
