0
我有一個父pom.xml,它定義了帶有inherited = true的emma-maven-plugin。MAVEN3:如何在子項目中禁用emma-maven-plugin
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${maven.site.version}</version>
</plugin>
<plugin>
<groupId>org.sonatype.maven.plugin</groupId>
<artifactId>emma-maven-plugin</artifactId>
<version>${emma.maven.version}</version>
<inherited>true</inherited>
</plugin>
</plugins>
</reporting>
但是我有一個不包含任何測試的子pom.xml。所以我嘗試添加這個......執行無,繼承false並跳過真正跳過艾瑪報告生成,但它似乎並沒有工作。有任何想法嗎?
<build>
<plugins>
<plugin>
<groupId>org.sonatype.maven.plugin</groupId>
<artifactId>emma-maven-plugin</artifactId>
<version>${emma.maven.version}</version>
<inherited>false</inherited>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.sonatype.maven.plugin</groupId>
<artifactId>emma-maven-plugin</artifactId>
<version>${emma.maven.version}</version>
<inherited>false</inherited>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</reporting>
試試以下的答案http://stackoverflow.com/questions/7821152/disable-a-maven-plugin-defined-in-a-parent-pom – sasankad