maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <bimargul...@gmail.com>
Subject PMD plugin and classpath management
Date Sat, 10 May 2008 01:45:02 GMT
I have written a custom Java rule. I'm now trying to make it run inside
mvn.

One project builds the rule, the others run PMD with it.

To code the rule to begin with, I added a POM dependency for the pmd/pmd
artifact, version 4.2. At runtime, I get a failure complaining that I'm
trying to override AbstractJavaRule.

So, I tried changing the scope of the pmd dependency to provided, on the
theory that the plugin would indeed, well, \provide/ it. No such luck,
now I get a class not found for AbstractJavaRule.

What's the recipe here?



[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] class net.sourceforge.pmd.AbstractJavaRule overrides final method
 .
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.VerifyError: class net.sourceforge.pmd.AbstractJavaRule
overrides final method .
	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$100(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.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$100(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
net.sourceforge.pmd.RuleSetFactory.parseInternallyDefinedRuleNode(RuleSetFactory.java:278)
	at
net.sourceforge.pmd.RuleSetFactory.parseRuleNode(RuleSetFactory.java:261)
	at
net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java:199)
	at
net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java:172)
	at
org.apache.maven.plugin.pmd.PmdReport.executeReport(PmdReport.java:184)
	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:447)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java


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


Mime
View raw message