in maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java [485:537]
private Path getJavadocLocation() throws IOException {
Path location = null;
if (linkJavadoc) {
// We don't need to do the whole translation thing like normal, because JXR does it internally.
// It probably shouldn't.
if (getJavadocDir().exists()) {
// XRef was already generated by manual execution of a lifecycle binding
location = getJavadocDir().toPath().toAbsolutePath();
} else {
// Not yet generated - check if the report is on its way
// Special case: using the site:stage goal
String stagingDirectory = System.getProperty("stagingDirectory");
if (stagingDirectory != null && !stagingDirectory.isEmpty()) {
String javadocDestDir = getJavadocDir().getName();
boolean javadocAggregate = JxrReportUtil.isJavadocAggregated(project);
String structureProject = JxrReportUtil.getStructure(project, false);
if (isAggregate() && javadocAggregate) {
location = Paths.get(stagingDirectory, structureProject, javadocDestDir);
}
if (!isAggregate() && javadocAggregate) {
location = Paths.get(stagingDirectory, javadocDestDir);
String hierarchy = project.getName();
MavenProject parent = project.getParent();
while (parent != null) {
hierarchy = parent.getName();
parent = parent.getParent();
}
location = Paths.get(stagingDirectory, hierarchy, javadocDestDir);
}
if (isAggregate() && !javadocAggregate) {
getLog().warn("The JXR plugin is configured to build an aggregated report at the root, "
+ "not the Javadoc plugin.");
}
if (!isAggregate() && !javadocAggregate) {
location = Paths.get(stagingDirectory, structureProject, javadocDestDir);
}
} else {
location = getJavadocDir().toPath();
}
}
if (location == null) {
getLog().warn("Unable to locate Javadoc to link to - DISABLED");
}
}
return location;
}