Generating source references with the Maven JXR plugin
You may have observed the following warnings when running the PMD or Checkstyle plugin:
[INFO] --- maven-pmd-plugin:3.2:pmd (default-cli) @ project-with-violations --- [WARNING] Unable to locate Source XRef to link to – DISABLED [INFO] --- maven-checkstyle-plugin:2.13:checkstyle (default-cli) @ project-with-violations --- [INFO] [INFO] There are 36 checkstyle errors. [WARNING] Unable to locate Source XRef to link to – DISABLED
The plugins attempt to link the violation to the specific lines in the cross-reference of the source. As they are unable to find this cross-reference, they display the warning.
To generate this cross-reference, we need to use the Maven JXR plugin.
How to do it...
Use the following steps to generate source references with the Maven JXR plugin:
Open the project for which you want to run the cross-reference.
Run the following Maven command:
mvn jxr:jxr
Observe the output:
[INFO] [INFO] --- maven-jxr-plugin:2.5:jxr (default...