Dawson
Dawson

Reputation: 457

Save output from PMD Eclipse plugin

I know PMD can be exectued on command line and an output file specified there, but for certain reasons simply saving the Eclipse plugin results to a file would make life easier.

Is there any way to do this? I've hunted around for this but haven't found a solution.

Upvotes: 2

Views: 5450

Answers (1)

adangel
adangel

Reputation: 1910

This functionality is a bit hidden, but it exists.

  1. Go to "Window -> Preferences -> PMD -> Reports" and select the report format, you want, e.g. "text".
  2. Right-click on the project and select "PMD -> Check Code".
  3. Right-click on the project and select "PMD -> Generate Reports".

Now, you should have a new folder reports in your project, which contains a file pmd-report.txt.

It seems, that a report is only created, if there are violations, hence the 2nd step (e.g. there must be at least one violation marked in the project).

Edit: This assumes, you are using the pmd-eclipse plugin from this update site: https://sourceforge.net/projects/pmd/files/pmd-eclipse/update-site/ - note, there is also an alternative eclipse-pmd plugin available.

Upvotes: 5

Related Questions