为什么无法实现对Uber jar的传递依赖?

Why can't transitive dependency on Uber jar be achieved?

根据传递依赖的概念,如果是一个项目,就说A对X jar有依赖,包含在A的pom.xml中。现在我的第二个项目,假设它 B 依赖于项目 A 和 X jar。所以现在在我的 B 的 pom.xml 中,我将仅在其依赖项中添加项目 A,因为 X jar 由 A 通过传递依赖的概念提供服务。

但是如果我有一个 Uber(阴影)jar 而不是 X jar,那么当我构建项目 B 时,它会失败,说 Uber jar 中包含的包丢失了。意味着这个概念是失败的。

如果我遗漏了任何概念或未能理解传递依赖,请帮助我理解。

com.adobe.aem:uber-jar 依赖项通常具有 <scope>provided。这也是大多数 AEM Maven 依赖项的情况。

provided 依赖项 不是 可传递的,请阅读有关传递依赖项的 Maven 文档:https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

在上面的 maven 文档 link 中,请阅读 "Dependency Scope" 部分。

来自文档:

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.