문제

Is there a syntactic way in a pom file to exclude a dependency of a transitive dependency.

For example, if A has a dependency B and B has a dependency C and C has a dependency on D, a way to exclude dependency D when compiling A.

Exclusions for a dependency only seem to go one level deep.

How I have accomplished this in the past is to include dependency C in A's pom and then add the exclusion for D in C's dependency declaration. Is this the recommended way?

도움이 되었습니까?

해결책

You can add an <exclusions> element for D to the dependency B in the POM of A. Exclusions work recursively on transitive dependencies.

A good way to do this for a complex project is to use an <dependencyManagement> element in the parent POM which excludes anything you don't want to see anywhere.

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