Book Image

Apache Maven Cookbook

Book Image

Apache Maven Cookbook

Overview of this book

Table of Contents (18 chapters)
Apache Maven Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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:

  1. Open the project for which you want to run the cross-reference.

  2. Run the following Maven command:

    mvn jxr:jxr
    
  3. Observe the output:

    [INFO]
    [INFO] --- maven-jxr-plugin:2.5:jxr (default...