[ 
https://issues.apache.org/jira/browse/MCHECKSTYLE-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15352982#comment-15352982
 ] 

Romain Manni-Bucau commented on MCHECKSTYLE-324:
------------------------------------------------

just this pom.xml should reproduce it:

{code}
<?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";>
  <modelVersion>4.0.0</modelVersion>

  <groupId>MCHECKSTYLE-324</groupId>
  <artifactId>MCHECKSTYLE-324</artifactId>
  <version>1.0-SNAPSHOT</version>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-checkstyle-plugin</artifactId>
      <version>2.17</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.17</version>
        <executions>
          <execution>
            <id>verify-style</id>
            <phase>process-classes</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <checkstyleRules>
            <module name="Checker">
              <module name="SuppressionCommentFilter" />
            </module>
          </checkstyleRules>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
{code}

you need to run in debug and see that the checkstyle mojo line:

{code}
File configFile = locator.getResourceAsFile( request.getConfigLocation(), 
"checkstyle-checker.xml" );
{code}

likely go through org.codehaus.plexus.resource.loader.URLResourceLoader before 
jar then FileResourceLoader which pollutes logs with this message.

The case of File being trivial enough to check it would be great to be able to 
get rid of it

Note: I'll update the title since it is misleading

> inline checkstyle rules fails on windows
> ----------------------------------------
>
>                 Key: MCHECKSTYLE-324
>                 URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-324
>             Project: Maven Checkstyle Plugin
>          Issue Type: Bug
>            Reporter: Romain Manni-Bucau
>            Priority: Minor
>
> Seems 
> {code}
> configLocation = rulesFiles.getAbsolutePath();
> {code}
> should be
> {code}
> configLocation = rulesFiles.toURI().toURL().toExternalForm();
> {code}
> should use a URI instead of a file path for windows otherwise you get
> {code}
> [DEBUG] URLResourceLoader: Exception when looking for 
> 'C:\cygwin\drone\src\github.com\rmannibucau\crest\target\checkstyle-rules.xml'
>  at ''
> java.net.MalformedURLException: unknown protocol: c
>       at java.net.URL.<init>(URL.java:600)
>       at java.net.URL.<init>(URL.java:490)
>       at java.net.URL.<init>(URL.java:439)
>       at 
> org.codehaus.plexus.resource.loader.URLResourceLoader.getResource(URLResourceLoader.java:71)
>       at 
> org.codehaus.plexus.resource.DefaultResourceManager.getResource(DefaultResourceManager.java:159)
>       at 
> org.codehaus.plexus.resource.DefaultResourceManager.getResourceAsFile(DefaultResourceManager.java:91)
>       at 
> org.apache.maven.plugin.checkstyle.exec.DefaultCheckstyleExecutor.getConfigFile(DefaultCheckstyleExecutor.java:822)
>       at 
> org.apache.maven.plugin.checkstyle.exec.DefaultCheckstyleExecutor.getConfiguration(DefaultCheckstyleExecutor.java:378)
>       at 
> org.apache.maven.plugin.checkstyle.exec.DefaultCheckstyleExecutor.executeCheckstyle(DefaultCheckstyleExecutor.java:217)
>       at 
> org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute(CheckstyleViolationCheckMojo.java:538)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to