【发布时间】:2011-05-29 01:32:53
【问题描述】:
有一个多模块 Maven-3 项目,其中一个子模块在所有其他模块中用作<dependency>。同时,所有子模块都继承自父模块。这样的结构导致循环依赖。我该如何解决?
项目结构比较典型:
/foo
/foo-testkit
/foo-core
这是家长foo/pom.xml:
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>checkstyle/checks.xml</configLocation>
</configuration>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>foo-testkit</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
[...]
在父 foo/pom.xml 中,我指定了在每个子模块中必须如何以及何时执行 checkstyle 插件。但是我不需要在foo-testkit中执行checkstyle,它是一个继承自foo的子模块,但同时也是一个依赖..
【问题讨论】:
标签: java maven-2 maven maven-3