我有一个使用 Maven 工具通过整洁架构设计的项目。
我的入口点模块(E)依赖于下一个级别,即用例(UC)模块和E模块之间的桥梁(BR)。该 BR 模块依赖于 UC 模块,这意味着 UC 对 E 也是可见的。我可以更改 moduleS 的 pom.xml
中的某些内容,以便 E 不会看到 UC,但会看到正在看到 UC 的 BR 模块吗?
换句话说,我有这样的东西:
E
我写了理论问题,因为我无法分享有关项目政策的代码。
最佳答案
参见POM Reference – Exclusions :
Exclusions explicitly tell Maven that you don't want to include the specified project that is a dependency of this dependency (in other words, its transitive dependency). For example, the [
BR
] requires [UC
], and we do not wish to use it or its dependencies, then we would add it as anexclusion
.
因此,您将 BR 作为 E 中的依赖项。在后者中,您将 UC 声明为 <exclusion>
在 BR 的 <dependency>
声明。
关于maven - 整洁的架构 Maven 模块依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47477435/