0

According to the concept of transitive dependency, if a project, say it A has dependency on X jar and is included in A's pom.xml. Now my second project, say it B has dependency on both project A and X jar. So now in my B's pom.xml I'll add only project A in its dependency, as X jar is served by A by concept of transitive dependency.

But instead of X jar if I have an Uber(shaded) jar then when I build project B, it fails saying packages included in Uber jar are missing. Means the concept is failing.

Please help me understand if I'm missing any concept or miss understanding transitive dependency.

1 Answers1

0

The com.adobe.aem:uber-jar dependency typically has the <scope> set provided. This also the case for most AEM maven dependencies.

provided dependencies are not transitive, please read the maven doc on transitive dependencies: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

in the maven doc link above, please read the "Dependency Scope" section.

From the doc:

provided: This is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive.

Ahmed Musallam
  • 9,523
  • 4
  • 27
  • 47