You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Lewis, Eric" <Er...@ipi.ch> on 2009/02/19 16:20:04 UTC

How to use Checkstyle 5

Hi

Has anyone tried to use the Checkstyle plugin with Checkstyle 5 beta?

The plugin uses 4.4, but I tried the following hack
http://www.sonatype.com/people/2008/04/23/

Here's my configuration:

<pluginManagement>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-checkstyle-plugin</artifactId>
      <configuration>
 
<configLocation>${build.home}checkstyle/checkstyle.xml</configLocation>
        <enableRSS>false</enableRSS>
        <includeTestSourceDirectory>false</includeTestSourceDirectory>
      </configuration>
      <dependencies>
        <dependency>
          <groupId>checkstyle</groupId>
          <artifactId>checkstyle</artifactId>
          <version>5.0-beta01</version>
        </dependency>
      </dependencies>
    </plugin>
  </plugins>
</pluginManagement>

When I run it, I get

[INFO] [checkstyle:checkstyle]
[FATAL ERROR]
org.apache.maven.plugin.checkstyle.CheckstyleReport#execute() caused a
linkage error (java.lang.NoSuchMethodError) and may be out-of-date.
Check the realms:
[FATAL ERROR] Plugin realm =
app0.child-container[org.apache.maven.plugins:maven-checkstyle-plugin]
...
[FATAL ERROR] Container realm = plexus.core
...
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO]
com.puppycrawl.tools.checkstyle.PackageNamesLoader.loadModuleFactory(Lja
va/lang/ClassLoader;)Lcom/puppycrawl/tools/checkstyle/ModuleFactory;
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.NoSuchMethodError:
com.puppycrawl.tools.checkstyle.PackageNamesLoader.loadModuleFactory(Lja
va/lang/ClassLoader;)Lcom/puppycrawl/tools/checkstyle/ModuleFactory;
	at
org.apache.maven.plugin.checkstyle.CheckstyleReport.getModuleFactory(Che
ckstyleReport.java:1157)
	at
org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(Checks
tyleReport.java:605)
	at
org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenRep
ort.java:98)
	at
org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenRepo
rt.java:73)
	at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa
nager.java:451)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:558)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoa
l(DefaultLifecycleExecutor.java:512)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
ifecycleExecutor.java:482)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.java:330)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:291)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
ycleExecutor.java:142)
	at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
...

Has anyone tried and succeeded?

Best regards,
Eric

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


Re: AW: How to use Checkstyle 5

Posted by Dennis Lundberg <de...@apache.org>.
See

http://jira.codehaus.org/browse/MCHECKSTYLE-105


Lewis, Eric wrote:
> Yep, I read it, I was just hoping...  :-)
> 
> Does anyone know whether Checkstyle 5 is on the Checkstyle Plugin's agenda?
> 
> Best regards,
> Eric 
> 
>> -----Ursprüngliche Nachricht-----
>> Von: Wayne Fay [mailto:waynefay@gmail.com] 
>> Gesendet: Donnerstag, 19. Februar 2009 19:56
>> An: Maven Users List
>> Betreff: Re: How to use Checkstyle 5
>>
>>> Has anyone tried to use the Checkstyle plugin with 
>> Checkstyle 5 beta?
>>> The plugin uses 4.4, but I tried the following hack
>>> http://www.sonatype.com/people/2008/04/23/
>> Did you read this on that page:
>> "That was easy, right? As long as the new version you have introduced
>> is api compatible with the version the plugin was linked against, you
>> should be good."
>>
>> The error indicates that Checkstyle 5 is probably not "api compatible"
>> with Checkstyle 4. Therefore, you get breaks like you're experiencing.
>>
>> Wayne
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


-- 
Dennis Lundberg

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


AW: How to use Checkstyle 5

Posted by "Lewis, Eric" <Er...@ipi.ch>.
Yep, I read it, I was just hoping...  :-)

Does anyone know whether Checkstyle 5 is on the Checkstyle Plugin's agenda?

Best regards,
Eric 

> -----Ursprüngliche Nachricht-----
> Von: Wayne Fay [mailto:waynefay@gmail.com] 
> Gesendet: Donnerstag, 19. Februar 2009 19:56
> An: Maven Users List
> Betreff: Re: How to use Checkstyle 5
> 
> > Has anyone tried to use the Checkstyle plugin with 
> Checkstyle 5 beta?
> >
> > The plugin uses 4.4, but I tried the following hack
> > http://www.sonatype.com/people/2008/04/23/
> 
> Did you read this on that page:
> "That was easy, right? As long as the new version you have introduced
> is api compatible with the version the plugin was linked against, you
> should be good."
> 
> The error indicates that Checkstyle 5 is probably not "api compatible"
> with Checkstyle 4. Therefore, you get breaks like you're experiencing.
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

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


Re: How to use Checkstyle 5

Posted by Wayne Fay <wa...@gmail.com>.
> Has anyone tried to use the Checkstyle plugin with Checkstyle 5 beta?
>
> The plugin uses 4.4, but I tried the following hack
> http://www.sonatype.com/people/2008/04/23/

Did you read this on that page:
"That was easy, right? As long as the new version you have introduced
is api compatible with the version the plugin was linked against, you
should be good."

The error indicates that Checkstyle 5 is probably not "api compatible"
with Checkstyle 4. Therefore, you get breaks like you're experiencing.

Wayne

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