Analyzing JavaScript Code

The PMD plugin analyzes by default java. You can configure it to analyze JavaScript files instead as shown below.

The example assumes that the javascript source code is stored in the subfolder src/main/javascript and enables three built-in rulesets (basic, braces, unnecessary).

Note that you have to make sure that the build-helper-maven-plugin is executed, so that the additional source folder is actually added. To generate the site report, you can include e.g. the generate-sources phase:

mvn generate-sources site