tags:

views:

15

answers:

1

Hi everybody.

I'm using Netbeans to build a GUI application and PMD "complains" about things in the auto-generated code. Can I configure PMD to ignore auto-generated code (as I did with Checkstyle)?

Thank you.

+1  A: 

There are a couple things that you can do:

A. Alter the template for the type of form to include some of the magic strings that are discussed on this page about suppressing PMD warnings.

  1. Use the Templates item of the Tools menu to open the 'Template Manager' dialog.

  2. Find the folder labeled 'Swing GUI Forms' and expand that node.

  3. Select a template and press the 'Open in Editor' button.

  4. Change the @SuppressWarnings("unchecked") to @SuppressWarnings({"unchecked", "PMD"})

Note: You can apply this last step to any of the forms that you have already created.

B. Create a ruleset that does not include the warnings that get violated by the generated code and use that ruleset instead. There is a page that discusses creating rulesets and a page that describes how to direct PMD to use an explicit ruleset when executed from the command line.

vkraemer
Thank you for your response :D
manolowar