2017-10-18 6 views
0

Ich habe ein Problem. Es sieht so aus, als ob meine Checkstyle-Unterdrückungen ignoriert werden. Ich bin sicher, dass der Pfad zur Datei korrekt ist (checkstyle.xml wird korrekt geladen), aber checkstyle-suppressions funktioniert nicht. Weißt du, was könnte falsch sein? Unten ist mein Maven-Konfiguration:Warum werden meine Checkstyle-Ausdrücke ignoriert?

<?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> 

Und meine custom-check-supressions Datei:

<?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> 

Vielen Dank

+0

Mögliches Duplikat von [CheckStyle-Checks wurden nicht ignoriert] (https://stackoverflow.com/questions/15573743/checkstyle-checks-not-been-ignored) –

Antwort

0

I

<module name="SuppressionFilter"> 
    <property name="file" value="custom-checkstyle-suppressions.xml"/> 
</module> 

zu Checker hinzufügen hatte Modul in checstyle.xml

Verwandte Themen