Eclipse Pmd Ruleset File

Active4 months ago

Join GitHub today. GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together. We have configured the PMD eclipse plugin to use a ruleset file local to our project. See attached.pmd from one of our projects. This did not work.

I am using PMD under eclipse 4.3.1 / Kepler and I cannot exclude files and folders from the violation check.

My folder structure

Now following folders get generated by testng

Ruleset

Eclipse Pmd Ruleset File Size

Now I have configured following rules file:

In my case I have many hundred errors in the jquery.js file, which is in test-output.

How can I exclude a specific folder and all files in it recursively?

How to set the pattern to work under eclipse and under ANT/maven?

hint: seems to be similar to: PMD exclude not working

Community
Java
hkaishkais

2 Answers

You almost got it already! Use the following exclusion syntax:

This will exclude all files that have /test-output/ somewhere in their absolute path. The pattern is the same in Eclipse and Ant/Maven, as long as the excluded folders are also called test-output.

Additional explanations and examples can be found in the PMD documentation.

barfuinbarfuin
11.7k7 gold badges62 silver badges105 bronze badges

You can specify a working set under Project -> Properties -> PMD

Marco SullaMarco Sulla

Ruleset File

8,7906 gold badges30 silver badges56 bronze badges

Not the answer you're looking for? Browse other questions tagged eclipsepmd or ask your own question.

Active8 years, 4 months ago

I find PMD very useful tool. So I have installed PMD eclipse plugin.

With PMD, we can define multiple ruleset files. One of the reason I have multiple rulesets file is that I need to exclude some classes from some rules say naming rules but not all. I achieved this by defined those rules in a separate ruleset file and using element. This is fine as far ant build is concerned. However, I would like to use the same ruleset files for PMD eclipse plugins to ensure that executing PMD using ant or eclipse generates same result.

I do not see an option to select multiple ruleset files for PMD eclipse plugin. Is there a way to select multiple ruleset files or any other alternative?

Please help.

Thanks

Eclipse Pmd Ruleset File Free

Chir

Eclipse Pmd Ruleset File Download

Chir
3461 gold badge8 silver badges26 bronze badges

1 Answer

A rulesets references rules and built-in rulesets - and it can reference custom rulesets too. Just create a wrapper-ruleset.xml for basic-ruleset.xml and codesize-ruleset.xml:

You can then use wrapper-ruleset.xml in Eclipse.

Martin AckermannMartin Ackermann

Pmd Plugin For Eclipse

Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.

Visual Studio Ruleset File

Not the answer you're looking for? Browse other questions tagged javaeclipsepmd or ask your own question.