我想确定是我做错了什么还是maven checkstyle插件的bug。如果我输入mvn checkstyle:check
,会得到以下结果:
jonathanfisher@odin ~/dev/snapjms/snapjms $ mvn checkstyle:check
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building snapjms 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-checkstyle-plugin:2.17:check (default-cli) @ snapjms ---
[INFO] There is 1 error reported by Checkstyle 6.11.2 with /Users/jonathanfisher/dev/snapjms/snapjms/target/checkstyle-rules.xml ruleset.
[ERROR] src/main/java/org/xxx/xxx/snapjms/jms/factories/UnsupportedPayloadException.java:[8] (sizes) LineLength: Line is longer than 135 characters (found 144).
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.411 s
[INFO] Finished at: 2016-06-16T15:33:58-05:00
[INFO] Final Memory: 17M/371M
如果我执行
mvn checkstyle:checkstyle
,注意它会切换到sun_checks.xml
:jonathanfisher@odin ~/dev/snapjms/snapjms $ mvn checkstyle:checkstyle
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building snapjms 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-checkstyle-plugin:2.17:checkstyle (default-cli) @ snapjms ---
[INFO] There are 451 errors reported by Checkstyle 6.11.2 with sun_checks.xml ruleset.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.904 s
[INFO] Finished at: 2016-06-16T15:35:46-05:00
[INFO] Final Memory: 24M/361M
这是我的内联配置:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<inherited>true</inherited>
<configuration>
<logViolationsToConsole>true</logViolationsToConsole>
<checkstyleRules>
<module name="Checker">
<module name="SuppressionCommentFilter" />
<module name="LineLength">
<property
name="max"
value="135" />
<property
name="ignorePattern"
value="@version|@see" />
</module>
</checkstyleRules>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
</plugins>
</build>
<reporting>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
</reporting>
关于 mvn:site
的报告也使用了 sun_checks.xml
。我做错了什么吗?