I have a library A, which depends on the libraries B and C. I unpack the libraries classes of B and C into the jar for library A using the maven-dependency-plugin (see below).
Now, when a library D uses library A, library D can access all the classes of A, B and C. However, I want D only to depend on A but not on the transitive dependencies B and C.
I know this can be achieved by manually excluding B and C for the dependency A-D but I would like to somehow declare in A that B and C are not to be made known to modules using A.
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>