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.