Maven-checktyle-plugin忽略配置排除

时间:2018-10-19 07:09:24

标签: maven checkstyle maven-checkstyle-plugin

我对checkstyle插件有这样的配置 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>${test.checkstyle.version}</version> <configuration> <enableRulesSummary>false</enableRulesSummary> <linkXRef>false</linkXRef> <encoding>UTF-8</encoding> <consoleOutput>true</consoleOutput> <logViolationsToConsole>true</logViolationsToConsole> <failsOnError>false</failsOnError> <failOnViolation>true</failOnViolation> <configLocation>${proj_basedir}/checkstyle.xml</configLocation> <suppressionsLocation>${proj_basedir}/checkstyle-suppressions.xml</suppressionsLocation> <includeTestSourceDirectory>true</includeTestSourceDirectory> <excludes>**/generated-sources/**/*.java</excludes> </configuration> <dependencies> <dependency> <groupId>com.puppycrawl.tools</groupId> <artifactId>checkstyle</artifactId> <version>6.13</version> <exclusions> <!-- MCHECKSTYLE-156 --> <exclusion> <groupId>com.sun</groupId> <artifactId>tools</artifactId> </exclusion> </exclusions> </dependency> </dependencies> </plugin>

,当我运行mvn compile checkstyle:checkstyle -nsu -Dskip.unit.tests时,我发现存储在generated-sources文件夹中的文件的checkstyle失败。 enter image description here

我从项目的根目录和pom xml的plugins部分中指定的插件中运行此命令。我还尝试将exclude用作参数并获得相同的结果。还将checkstyle插件更新为最新版本。

0 个答案:

没有答案