我从父母那里获取依赖,那里需要大多数依赖。但是我也希望能够完全排除两个依赖项。我无法编辑父级,因此需要从我的POM文件中排除它。这有可能吗?我已经看到了覆盖示例,并且有很多建议可以修复父POM,如上所述,我目前无法这样做。
使用Maven 3.3.x
我的POM文件
<parent>
<groupId>com.company.stuff</groupId>
<artifactId>our-parent</artifactId>
<version>1.7</version>
</parent>
<!-- other dependencies and build and plugins -->
上面的父项引入了以下我希望完全排除的插件。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${some.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${some.version}</version>
</plugin>
有没有解决的办法?请指教。谢谢。
尝试了Thiago的建议,结果相同。
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.version}</version>
<executions>
<execution>
<id>maven-checkstyle-plugin</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
为什么不跳过插件执行呢?
您可以将skip
两个插件的参数都设置为true。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句