Maven takes care of transitive dependencies.
What is transitive
dependency?
Suppose project-A dependent on project-B, project-B
dependent on project-C, then project-A is transitively dependent on project-C.
If you are using maven, then you no need to worry about these dependencies,
maven will take care of these. You just specify that project-A dependencies,
maven will download all the transitive dependencies for you.
How to exclude a
specific dependency?
In some cases, you may not some of the transitive
dependencies to be set in your class path. In that case, you can exclude the
dependencies by specifying the group id and artifact id in the <exclusions>
element.
<dependency> <groupId>sample.ProjectB</groupId> <artifactId>Project-B</artifactId> <version>1.0</version> <scope>compile</scope> <exclusions> <exclusion> <groupId>sample.ProjectC</groupId> <artifactId>Project-C</artifactId> </exclusion> </exclusions> </dependency>
No comments:
Post a Comment