有一个多模块Maven-3项目,其中一个子模块在所有其他模块中用作<dependency>
。同时,所有子模块都从父模块继承。这样的结构导致循环依赖。我该如何解决它?如何解决补充Maven子模块中的循环依赖关系?
项目结构比较典型:
/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
继承的子模块,但同时也是依赖项。
我需要在``中使用``部分,因为我必须在那里声明插件``,这对所有子模块都很常见(请参阅我的问题更新)。 –
yegor256
2010-12-21 21:17:25
请注意,没有什么能够阻止您在``部分中指定``。 –
2010-12-22 07:40:24