0
我有問題。看起來我的checkstyle-supressions被忽略了。我確定文件路徑是正確的(checkstyle.xml加載正確),但checkstyle-supressions不起作用。你知道這可能是錯的嗎? 下面是我的Maven配置:爲什麼我的checkstyle-supressions被忽略?
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
...
<profiles>
<profile>
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.10</version>
<configuration>
<configLocation>custom-checkstyle.xml</configLocation>
<suppressionsLocation>custom-checkstyle-suppressions.xml</suppressionsLocation>
<includeTestSourceDirectory>false</includeTestSourceDirectory>
<enableFilesSummary>true</enableFilesSummary>
<failsOnError>true</failsOnError>
<consoleOutput>true</consoleOutput>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
...
</project>
而且我定製的CheckStyle-supressions文件:
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.0//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
<suppressions>
<suppress checks=".*"
files="src/main/java/model/Player.java"/>
</suppressions>
非常感謝
[CheckStyle檢查未被忽略]的可能重複(https://stackoverflow.com/questions/15573743/checkstyle-checks-not-been-ignored) –