[ 
http://jira.codehaus.org/browse/MCHECKSTYLE-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=137725#action_137725
 ] 

Dennis Lundberg commented on MCHECKSTYLE-97:
--------------------------------------------

Thanks for the sample project André, that is really helpful.

I think that you have something wrong in your local repository, because the 
sample projects works just fine for me. I'd like you to try this:

Delete the following directories from your local repository (usually in 
${user.home}/.m2/repository/)
* antlr
* commons-beanutils
* org/apache/maven/plugins/maven-checkstyle-plugin/

Run 'mvn clean'  and then 'mvn checkstyle:checkstyle' on your sample project.

For me the first invocation of Maven downloads maven-checkstyle-plugin 2.2. The 
second invocation downloads antlr 2.7.6 and commons-beanutils-core 1.7.0.

> Dependency Problem: commons-beanutils / antlr
> ---------------------------------------------
>
>                 Key: MCHECKSTYLE-97
>                 URL: http://jira.codehaus.org/browse/MCHECKSTYLE-97
>             Project: Maven 2.x Checkstyle Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>         Environment: W2K, Java 6u6, Maven 2.0.9
>            Reporter: André Fügenschuh
>            Priority: Minor
>         Attachments: checkstyle-dependencies.zip
>
>
> I guess this issue is a follow-up to *MCHECKSTYLE-90*.
> With version 2.2, I get the following errors running 'checkstyle:checkstyle':
> 1) commons-beanutils
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] org/apache/commons/beanutils/Converter
> org.apache.commons.beanutils.Converter
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NoClassDefFoundError: org/apache/commons/beanutils/Converter
>         at 
> org.apache.maven.plugin.checkstyle.CheckstyleReport.executeCheckstyle(CheckstyleReport.java:839)
>         at 
> org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(CheckstyleReport.java:635)
>         at 
> org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
>         at 
> org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:73)
>         at 
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
> a:330)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.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)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at 
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: java.lang.ClassNotFoundException: 
> org.apache.commons.beanutils.Converter
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>         at 
> org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
>         at 
> org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
>         at 
> org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
>         at 
> org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>         ... 22 more
> 2) antlr
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] antlr/CommonAST
> antlr.CommonAST
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NoClassDefFoundError: antlr/CommonAST
>         at java.lang.ClassLoader.defineClass1(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>         at 
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>         at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>         at 
> org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
>         at 
> org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
>         at 
> org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>         at java.lang.Class.getDeclaredMethods0(Native Method)
>         at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
>         at java.lang.Class.getDeclaredMethods(Class.java:1791)
>         at java.beans.Introspector$1.run(Introspector.java:1272)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at 
> java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1270)
>         at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1136)
>         at java.beans.Introspector.getBeanInfo(Introspector.java:387)
>         at java.beans.Introspector.getBeanInfo(Introspector.java:159)
>         at java.beans.Introspector.getBeanInfo(Introspector.java:220)
>         at java.beans.Introspector.<init>(Introspector.java:368)
>         at java.beans.Introspector.getBeanInfo(Introspector.java:159)
>         at java.beans.Introspector.getBeanInfo(Introspector.java:220)
>         at java.beans.Introspector.<init>(Introspector.java:368)
>         at java.beans.Introspector.getBeanInfo(Introspector.java:159)
>         at 
> org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:896)
>         at 
> org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:926)
>         at 
> org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:801)
>         at 
> org.apache.commons.beanutils.BeanUtilsBean.copyProperty(BeanUtilsBean.java:392)
>         at 
> com.puppycrawl.tools.checkstyle.api.AutomaticBean.contextualize(AutomaticBean.java:231)
>         at 
> com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:143)
>         at 
> com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:208)
>         at 
> org.apache.maven.plugin.checkstyle.CheckstyleReport.executeCheckstyle(CheckstyleReport.java:918)
>         at 
> org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(CheckstyleReport.java:635)
>         at 
> org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
>         at 
> org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:73)
>         at 
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
> a:330)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.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)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at 
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: java.lang.ClassNotFoundException: antlr.CommonAST
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>         at 
> org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
>         at 
> org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
>         at 
> org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
>         at 
> org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>         ... 58 more
> I'm using the checkstyle plugin as an 'extension' (as described in the docs 
> for multi-module usage) for multi-module projects as well as for standalone 
> projects - to have a general custom configuration.
> Workaround:
> Setting the error-causing plugins to the correct versions within the 
> configuration node of the plugin
> {code:xml}
>     <pluginManagement>
>       <plugins>
>         <plugin>
>           <groupId>org.apache.maven.plugins</groupId>
>           <artifactId>maven-checkstyle-plugin</artifactId>
>           <version>RELEASE</version>
>           <dependencies>
>             <dependency>
>               <groupId>antlr</groupId>
>               <artifactId>antlr</artifactId>
>               <version>2.7.6</version>
>             </dependency>
>             <dependency>
>               <groupId>commons-beanutils</groupId>
>               <artifactId>commons-beanutils</artifactId>
>               <version>1.7.0</version>
>             </dependency>
>           </dependencies>
>         </plugin>
> ...
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to