maven - 整洁的架构 Maven 模块依赖

标签 maven architecture dependencies clean-architecture

我有一个使用 Maven 工具通过整洁架构设计的项目。

我的入口点模块(E)依赖于下一个级别,即用例(UC)模块和E模块之间的桥梁(BR)。该 BR 模块依赖于 UC 模块,这意味着 UC 对 E 也是可见的。我可以更改 moduleS 的 pom.xml 中的某些内容,以便 E 不会看到 UC,但会看到正在看到 UC 的 BR 模块吗?

换句话说,我有这样的东西:

E BR UC ?如何对 E 隐藏 UC?

我写了理论问题,因为我无法分享有关项目政策的代码。

最佳答案

参见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 an exclusion.

因此,您将 BR 作为 E 中的依赖项。在后者中,您将 UC 声明为 <exclusion>在 BR 的 <dependency>声明。

关于maven - 整洁的架构 Maven 模块依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47477435/

相关文章:

java - 如何从 Hibernate 切换到 OpenJpa

tomcat - 参数没有注册配置(container [id = [tomcat7x]

.net - 当我们将主键传递给 UI 时,是否应该将其视为 2 层的混合和糟糕的做法?

java - 使用以数据为中心的方法在 Spring MVC 中维护干净的架构

SQL Server 2008 R2 DMV - sys.dm_sql_referencing_entities - 查询用法

java - Sikuli ImagePath 问题 (JAVA)

maven - 如何将 pom.xml 改造为 IntelliJ 项目?

caching - 存储另一个服务的数据是否违反微服务的单一职责原则

Android Ivy ActionBarSherlock

docker - docker :删除其他 docker 镜像上的文件/镜像依赖性