【发布时间】:2010-12-16 01:52:15
【问题描述】:
我使用 maven 构建一个多模块项目。我的模块 2 在编译范围依赖模块 1 src,在测试范围依赖模块 1 测试。
模块 2 -
<dependency>
<groupId>blah</groupId>
<artifactId>MODULE1</artifactId>
<version>blah</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
这很好用。假设我的模块 3 依赖于 Module1 src 并在编译时进行测试。
模块 3 -
<dependency>
<groupId>blah</groupId>
<artifactId>MODULE1</artifactId>
<version>blah</version>
<classifier>tests</classifier>
<scope>compile</scope>
</dependency>
当我运行mvn clean install 时,我的构建一直运行到模块 3,但在模块 3 处失败,因为它无法解决模块 1 的测试依赖关系。然后我单独在模块 3 上执行 mvn install,返回并在我的父 pom 上运行 mvn install 以使其构建。我该如何解决这个问题?
【问题讨论】:
-
您能分享一下您的父 pom 的样子吗?
标签: maven-2 maven-plugin