简体   繁体   中英

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.

This functionality is a bit hidden, but it exists.

  1. Go to "Window -> Preferences -> PMD -> Reports" and select the report format, you want, eg "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 (eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM