Aggregating JXR Reports for Multi-module Projects
The aggregate
parameter of the JXR Plugin can be used to generate JXR files for multi-module projects. Using this parameter, you can opt to generate one compiled set of JXR files for the whole project (all modules) or generate one set of JXR files for each module.
For example, you have the following directory structure:
Project |-- pom.xml |-- Module1 | |-- src | | `-- main | | `-- java | | `-- com | | `-- module1 | | `-- app | | `-- Module1App.java | `-- pom.xml |-- Module2 | |-- src | | `-- main | | `-- java | | `-- com | | `-- module2 | | `-- app | | `-- Module2App.java | `-- pom.xml `-- Module3 |-- src | `-- main | `-- java | `-- com | `-- module3 | `-- app | `-- Module3App.java `-- pom.xml
And you have the following configuration in your pom.xml
:
<project> ... <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> <version>3.5.0</version> <reportSets> <reportSet> <id>aggregate</id> <reports> <report>aggregate</report> <report>test-aggregate</report> </reports> </reportSet> </reportSets> </plugin> </plugins> ... </reporting> ... </project>
When you execute mvn site
from the parent directory, which is Project, a set of JXR files will be created in the target directory of Project where all of the JXR files of the project's submodules are included. Otherwise a set of JXR files for Module1 will be generated in the target directory of Module1, another set of JXR files for Module2 will be generated in the target directory of Module2, and so on.