【发布时间】:2016-06-20 20:57:05
【问题描述】:
我的应用程序中有模块 A 和模块 B。模块 A 具有模块 B 的依赖关系,如下所示。
模块 A pom.xml
<dependencies>
<dependency>
<groupId>group.id</groupId>
<artifactId>B</artifactId>
<type>jar</type>
</dependency>
</dependencies>
现在模块 B 需要访问模块 A 中定义的一个(一个)类。我尝试通过在模块 B 的 pom 中定义对模块 A 的依赖来做到这一点,如下所示,我得到了周期性异常。
The projects in the reactor contain a cyclic reference: Edge between
`'Vertex{label='A'}' and 'Vertex{label='B'}' introduces to cycle in the graph A --> B --> A
问题:我该如何解决这个问题?我只需要从模块 B 访问模块 A 中的几个类。
模块 B pom.xml
<dependencies>
<dependency>
<groupId>group.id</groupId>
<artifactId>A</artifactId>
<type>jar</type>
</dependency>
<dependencies>
【问题讨论】:
标签: java maven web-applications build