0
我的多模塊項目的結構如下:Maven的多模塊和插件調用
parent
module 1 <-- inherits from parent via <relativePath>../parent/pom.xml</relativePath>
module 2 <-- inherits from parent via <relativePath>../parent/pom.xml</relativePath>
aggregator <-- aggregates modules with <modules><module>
聚合器調用以下插件:
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>some path</destFile>
</configuration>
</execution>
</executions>
<configuration>
<append>true</append>
</configuration>
</plugin>
</plugins>
</build>
該插件呼籲聚合,但我想爲所有模塊(1和2)調用它。
我知道我可以更改父pom,但我想保持它乾淨(該更改是更大實現的一部分)。
是否有可能以這種方式配置插件,它要求所有模塊(就像放在父pom中一樣)?