Analyzing JavaScript Code

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

The example assumes that the JavaScript source code is stored in the subdirectory 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 directory is actually added. To generate the site report, you can include e.g. the generate-sources phase:

mvn generate-sources site