Checkstyle - non deterministic check result

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Checkstyle - non deterministic check result

xoue
This post has NOT been accepted by the mailing list yet.

Hello everyone,

I hope you can cast some light around this issue... I described it in Stackoverflow

 0 down vote favorite
       

I have a large JEE Maven Multi module project, and share a custom set of rules and suppressions for Checkstyle via build-tools module. I find very hard to release a stable version of this build-tools due to the testing of this same module.

Each time I run a Maven phase, I get a different execution result.

This is Checkstyle configuration in parent pom.xml:

<build>   
  <plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${checkstyle.plugin.version}</version>
        <configuration>
          <skip>${skipQATests}</skip>
          <configLocation>qa/checkstyle_rules.xml</configLocation>
          <propertiesLocation>${checkstyleDir}/checkstyle.properties</propertiesLocation>
          <suppressionsLocation>qa/suppressions.xml</suppressionsLocation>
          <encoding>UTF-8</encoding>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
          <failOnViolation>true</failOnViolation>
          <linkXRef>false</linkXRef>
        </configuration>
        <executions>
          <execution>
             <id>checkstyle-compile</id>
             <phase>compile</phase>                     
             <goals>
            <goal>check</goal>
             </goals>
          </execution>
        </executions>
    </plugin>
  </plugins>
</build>

I'm trying to find a pattern in the executions, project is set to fail in one particular check and I cannot find the 'bug'.

    I execute compile maven phase (mvn clean compile) and it fails on the given check.
    I execute package maven phase (mvn clean package) and it fails too.
    I execute again compile phase (mvn clean compile) and it doesn't fail (all SUCCESS)
    I execute again package and it fails
    It does not fail for a couple of runs and then it fails again on some different execution

I know this behavior is kind of difficult to trace without all project information. But is there any kind of procedure, log, tool that would give more information on debuging this problem so that I can determine if it's a bug or some mis-configuration??

I have just executed the same mvn command twice on the sub-module I'm testing Checkstyle (test that forces a rule violation) - mvn checkstyle:check -X

Result was different from each other, the main differences are that the CORRECT EXECUTION (the one that fails the build does not find the files at the first try) and the WRONG EXECUTION (the one that ends in SUCCESS finds the configuration files at the first attempt)

EXEC_1: ...

[DEBUG] The resource 'qa/suppressions.xml' was not found with resourceLoader org.codehaus.plexus.resource.loader.FileResourceLoader.    
[DEBUG] The resource 'qa/suppressions.xml' was found as jar:file:/C:/Users/usuario/.m2/repository/com/company/tools/build-tools/0.0.2-SNAPSHOT/build-tools-0.0.2-SNAPSHOT.jar!/qa/suppressions.xml.    
[DEBUG] Adding the outputDirectory file:/C:/LAB/PRJ/prj-ejbws/target/classes/ to the Checkstyle class path    
[DEBUG] The resource 'qa/checkstyle_N4_JEE.xml' was not found with resourceLoader org.codehaus.plexus.resource.loader.FileResourceLoader.    
[DEBUG] The resource 'qa/checkstyle_N4_JEE.xml' was found as jar:file:/C:/Users/usuario/.m2/repository/com/company/tools/build-tools/0.0.2-SNAPSHOT/build-tools-0.0.2-SNAPSHOT.jar!/qa/checkstyle_JEE.xml.    
[DEBUG] The resource 'ubic.properties' was found as C:\LAB\PRJ\ubic.properties.

[INFO] Starting audit...    
[INFO] --------------------------------------------
[INFO] BUILD FAILURE
[INFO] --------------------------------------------
[INFO] Total time: 1.542s
[INFO] Finished at: Thu Feb 20 16:35:22 CET 2014
[INFO] Final Memory: 8M/20M
[INFO] --------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.11:check (default-cli) on project GestionDelContacto-opsa-ejbws: Failed during checkstyle execution: There are 2 checkstyle errors.

EXEC_2:...

[DEBUG] The resource 'qa/suppressions.xml' was found as jar:file:/C:/Users/usuario/.m2/repository/com/company/tools/build-tools/0.0.2-SNAPSHOT/build-tools-0.0.2-SNAPSHOT.jar!/qa/suppressions.xml.    
[DEBUG] Adding the outputDirectory file:/C:/LAB/PRJ/prj-ejbws/target/classes/ to the Checkstyle class path    
[DEBUG] The resource 'qa/checkstyle_N4_JEE.xml' was found as jar:file:/C:/Users/usuario/.m2/repository/com/company/tools/build-tools/0.0.2-SNAPSHOT/build-tools-0.0.2-SNAPSHOT.jar!/qa/checkstyle_JEE.xml.    
[DEBUG] The resource 'ubic.properties' was not found with resourceLoader org.codehaus.plexus.resource.loader.ThreadContextClasspathResourceLoader.    
[DEBUG] The resource 'ubic.properties' was not found with resourceLoader org.codehaus.plexus.resource.loader.JarResourceLoader.    
[DEBUG] The resource 'ubic.properties' was found as C:\LAB\PRJ\ubic.properties.

[INFO] Starting audit...

[INFO] --------------------------------------------
[INFO] BUILD SUCCESS
[INFO] --------------------------------------------
[INFO] Total time: 1.570s
[INFO] Finished at: Thu Feb 20 16:37:05 CET 2014
[INFO] Final Memory: 8M/20M
[INFO] ---------------------------------------------

any clue?
Reply | Threaded
Open this post in threaded view
|

Re: Checkstyle - non deterministic check result

xoue
This post has NOT been accepted by the mailing list yet.
Mostly I'm having this problem around IllegalImports Check, with custom illegal packages, property expansion and suppressions.