You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gordon Cody <gc...@zafinlabs.com> on 2010/08/05 22:29:08 UTC

trouble with checkstyle

Hello List

checkstyle is not using my configuration (specifiied in pom). It seems to
insist on
picking up config/sun_checks.xml no matter what i try to do. Using
maven2.0.9
and checkstyle2.5. My project is setup like the multi-module example
project.

In my parent pom I have added to <build> section.

          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.5</version>
          <dependencies>
            <dependency>
              <groupId>com.zafinlabs.mirevenue</groupId>
              <artifactId>build-tools</artifactId>
              <version>${project.version}</version>
            </dependency>
          </dependencies>
        </plugin>

also in parent pom i added reporting section:
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <configLocation>mirevenue/zafin_checks.xml</configLocation>
          <headerLocation>mirevenue/LICENSE.txt</headerLocation>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
When I do clean:install I see the build-tools.x.y.jar in my local repo with
mirevenue/zafin_checks.xml and license.txt
When I do checkstyle:checkstyle -X I see the following:
[DEBUG] Adding the outputDirectory
file:/C:/spaces/zafin/mirevenue/miArchival/target/classes/ to the Checkstyle
class path
[DEBUG] request.getConfigLocation() config/sun_checks.xml
[DEBUG] The resource 'config/sun_checks.xml' was found as
jar:file:/C:/Documents and
Settings/test/.m2/repository/org/apache/maven/plugins/maven-checkstyle-plugin/2.5/maven-checkstyle-plugin-2.5.jar!/config/sun_checks.xml.
[DEBUG] headerLocation LICENSE.txt
[DEBUG] The resource 'LICENSE.txt' was found as jar:file:/C:/Documents and
Settings/test/.m2/repository/org/apache/maven/plugins/maven-checkstyle-plugin/2.5/maven-checkstyle-plugin-2.5.jar!/LICENSE.txt.
It is pulling the files it will use from maven-checkstyle-plugin-2.5.jar
instead of the ones I specify?
Any/all suggestions welcome.

Regards ,Gord

Re: trouble with checkstyle

Posted by Gordon Cody <gc...@zafinlabs.com>.
Hello Dennis

 Thanks for the link.
It does sound like that error. Pretty crippling (imo).

I found and installed maven-checkstyle-plugin-2.4.jar
and installed it in my artifactory. It took a while to find
one with valid META-INF\maven\plugin.xml.  Same results.

My suspicion is that if I upgraded from maven2.0.9 this problem
would disappear but that is not an option at this time.

Checkstyle 2.5 does work with my checkstyle.xml when configured
within each of my subprojects. So that is what I will be doing for now.

Thanks, Gord

Re: trouble with checkstyle

Posted by Dennis Lundberg <de...@apache.org>.
This sounds like
http://jira.codehaus.org/browse/MCHECKSTYLE-131

Either fall back to Checkstyle Plugin 2.4 or use the 2.6-SNAPSHOT.


On 2010-08-05 22:29, Gordon Cody wrote:
> Hello List
> 
> checkstyle is not using my configuration (specifiied in pom). It seems to
> insist on
> picking up config/sun_checks.xml no matter what i try to do. Using
> maven2.0.9
> and checkstyle2.5. My project is setup like the multi-module example
> project.
> 
> In my parent pom I have added to <build> section.
> 
>           <plugin>
>           <groupId>org.apache.maven.plugins</groupId>
>           <artifactId>maven-checkstyle-plugin</artifactId>
>           <version>2.5</version>
>           <dependencies>
>             <dependency>
>               <groupId>com.zafinlabs.mirevenue</groupId>
>               <artifactId>build-tools</artifactId>
>               <version>${project.version}</version>
>             </dependency>
>           </dependencies>
>         </plugin>
> 
> also in parent pom i added reporting section:
>   <reporting>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-checkstyle-plugin</artifactId>
>         <version>2.5</version>
>         <configuration>
>           <configLocation>mirevenue/zafin_checks.xml</configLocation>
>           <headerLocation>mirevenue/LICENSE.txt</headerLocation>
>         </configuration>
>       </plugin>
>     </plugins>
>   </reporting>
> When I do clean:install I see the build-tools.x.y.jar in my local repo with
> mirevenue/zafin_checks.xml and license.txt
> When I do checkstyle:checkstyle -X I see the following:
> [DEBUG] Adding the outputDirectory
> file:/C:/spaces/zafin/mirevenue/miArchival/target/classes/ to the Checkstyle
> class path
> [DEBUG] request.getConfigLocation() config/sun_checks.xml
> [DEBUG] The resource 'config/sun_checks.xml' was found as
> jar:file:/C:/Documents and
> Settings/test/.m2/repository/org/apache/maven/plugins/maven-checkstyle-plugin/2.5/maven-checkstyle-plugin-2.5.jar!/config/sun_checks.xml.
> [DEBUG] headerLocation LICENSE.txt
> [DEBUG] The resource 'LICENSE.txt' was found as jar:file:/C:/Documents and
> Settings/test/.m2/repository/org/apache/maven/plugins/maven-checkstyle-plugin/2.5/maven-checkstyle-plugin-2.5.jar!/LICENSE.txt.
> It is pulling the files it will use from maven-checkstyle-plugin-2.5.jar
> instead of the ones I specify?
> Any/all suggestions welcome.
> 
> Regards ,Gord
> 


-- 
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org