maven checkstyle无法找到插入包含配置的位置
我们有一个 Maven 项目,我在构建过程中使用了 checkstyle 插件,我们非常喜欢 checkstyle。无论如何,最近我们需要将 Web 服务插入到我们的项目中。 Web 服务类与 checkstyle 不兼容,因此我们希望在构建时排除它们。因此,作为排除的一种方式,我们要指定要包含的文件夹。
我遇到过 maven.checkstyle.includes 和 checkstyle 插件的 sourceDirectory 。但我无法弄清楚如何在 pom.xml 中使用它们。
有人有主意吗?
这是我的 pom.xml 的 checkstyle 部分
<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>
We have a maven project where I use a checkstyle plugin in the build process and we are very fond of checkstyle. Anyway recently we need to insert web services to our project. The web services classes are not compatible with checkstyle so we want to exclude them when building. So as a way of exclude we want to specify the folders to be included.
I have come across maven.checkstyle.includes and sourceDirectory of checkstyle plugin. But I could not be able to figure out how to use them in pom.xml.
Anyone have an idea?
Here is my checkstyle section of 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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将其添加到您的配置部分。这些是 ant 风格的模式,您可以通过用逗号分隔它们来为插件提供多个模式。
Add this to your configuration section. These are ant style patterns and you can give the plugin multiple patterns by separating them with a comma.