From the course: Introduction to Maven
Unlock this course with a free trial
Join today to access over 25,100 courses taught by industry experts.
Transative dependencies - Maven Tutorial
From the course: Introduction to Maven
Transative dependencies
- [Narrator] One of the hardest aspects to grasp about Maven is how it handles dependency resolution, specifically through the concept of transitive dependencies. So you may be asking yourself at this point, what is this transitive concept? In short, a transitive dependency is a dependency of a dependency and so on. It provides a mechanism to not have to actually declare all of your actual dependencies, instead, focusing on what you know about. This reduces your need to know the inner workings of libraries while also isolating you from changes when upgrading versions. As you might imagine, since software is managing this transitive dependency process, there are rules, and these rules can get you if you don't know them. The first rule is that when two versions of an artifact are needed, the one closest to the actual project wins. Meaning if A has B and C, B relies on Z 1.0 and C relies on D, which also relies on Z 1.2, Maven will pick the version 1.0 because it's closer to A, two…