I have the same problem, and it's a bug in the core grammar of PMD 
(http://sourceforge.net/tracker/index.php?func=detail&aid=1339470&group_id=56262&atid=479921).
 It doesn't look like it's getting fixed any time soon, but there's a patch at 
http://jira.codehaus.org/browse/MPMD-16 that works with the head revision of 
the plugin. What it allows is for you to exclude paths from PMD's operation, so 
the run will ignore them and not crash. Not the ideal solution, but it should 
get you running.

Nick

-----Original Message-----
From: François-Xavier Busch [mailto:[EMAIL PROTECTED] 
Sent: 22 February 2006 17:40
To: [email protected]
Subject: pmd : how to use custom ruleset ?

Hi,

I try to use the pmd plugin for maven2 but it fails with the error  :

Embedded error: Failure executing PMD for: ... MyClass.java Encountered "{ 
variable =" at line 13, column 3.
Was expecting one of:
    "abstract" ...
    "boolean" ...

My class looks like that :

public class MyClass extends AnOtherClass {
     {
         variable = someValue;
     }
}

I know this kind of code is not recommended but I need to keep it. So I wonder 
how I can make it work without changing my code.
I try to use a custom ruleset to exclude the rule that seems to trigger the 
error :

<rule ref="rulesets/design.xml">
  <exclude name="NonStaticInitializer"/> </rule>

but it doesn't work much better.

If anyone can help !
Thanks.
 
       This message may contain privileged and/or confidential information.  If 
you have received this e-mail in error or are not the intended recipient, you 
may not use, copy, disseminate or distribute it; do not open any attachments, 
delete it immediately from your system and notify the sender promptly by e-mail 
that you have done so.  Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to