【发布时间】:2011-02-14 09:35:22
【问题描述】:
我是 maven 和 chekstyle 的新手,所以需要问一些问题...我想在基于 maven 的项目中使用 checkstyle,所以在我的 pom.xml 中添加了依赖项
<dependency>
<groupId>checkstyle</groupId>
<artifactId>checkstyle</artifactId>
<version>2.4</version>
</dependency>
我还在插件标签中添加了条目:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.4</version>
<configuration>
<enableRulesSummary>true</enableRulesSummary>
<configLocation>checkstyle.xml</configLocation>
</configuration>
</plugin>
但是当我使用命令 mvn clean install 运行我的 maven 构建时,checkstyle 没有做任何事情。由于我的系统中还没有任何checkstyle.xml,它不应该抱怨我的错误吗?
我还缺少什么配置?
【问题讨论】:
-
你也可以看看qulice-maven-plugin,它结合了 Checkstyle、PMD、FindBugs 和其他一些静态分析器,并预先配置了它们
标签: maven-2 checkstyle