Linking JXR Files to Javadocs

To link the generated JXR files to the Javadocs, you need to set the following JXR Plugin configuration in your pom.xml:

<project>
  ...
  <reporting>
    <plugins>
      ...
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>3.4.0</version>
        <configuration>
          ...
          <linkJavadoc>true</linkJavadoc>
          <javadocDir>/path/to/javadocs</javadocDir>
          ...
        </configuration>
      </plugin>
    </plugins>
  ...
  </reporting>
  ...
</project>

The generated JXR pages will have a link named "View Javadoc" that will display the Javadoc of the class. In case there were no existing Javadocs in the specified Javadoc directory and no Javadocs will be generated (meaning no Javadoc Plugin configuration in the reporting section of the POM), the link will not be displayed even if the linkJavadoc parameter is set to true.

Take note that if the destDir parameter is set in the Javadoc Plugin configuration, you need to also set the javadocDir parameter of the JXR Plugin to the same directory.