0
我們有一個maven項目,在構建過程中使用checkstyle插件,我們非常喜歡checkstyle。無論如何,我們最近需要將Web服務插入到我們的項目中。 Web服務類與checkstyle不兼容,所以我們希望在構建時排除它們。因此,作爲一種排除方式,我們希望指定要包含的文件夾。maven checkstyle無法找到插入包含配置的位置
我遇到過checkstyle插件的maven.checkstyle.includes和sourceDirectory。但我無法弄清楚如何在pom.xml中使用它們。
任何人有想法?
這裏是我的pom.xml
<build>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<failsOnError>true</failsOnError>
<consoleOutput>true</consoleOutput>
<configLocation>sample_config.xml</configLocation>
<sourceDirectory>${maven.checkstyle.includes}</sourceDirectory>
</configuration>
</plugin>
...
</build>