【发布时间】:2014-11-27 05:46:44
【问题描述】:
我想覆盖 maven checkstyle 插件中的 configLocation 选项。 POM.xml 的示例部分是:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<configLocation>blahblah/checkstyle/checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
</configuration>
<dependencies>
<dependency>
<groupId>com.example.blahblah</groupId>
<artifactId>checkstyle-config</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<configuration>
<configLocation>checkstyle.config.xml</configLocation>
<suppressionsLocation>checkstyle.suppressions.xml</suppressionsLocation>
... other configuration ...
</configuration>
</plugin>
从上面可以看出,checkstyle-config 是一个单独的 maven 项目,其中包含样式检查的规则,用于规则的配置文件是 blahblah/checkstyle/checkstyle.xml。如果我必须覆盖 blahblah/checkstyle/checkstyle.xml 并使用存储在当前项目而不是 checkstyle-config 项目中的其他一些 .xml,那么我该怎么做?
【问题讨论】:
标签: java maven checkstyle