Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed Oct 20, 2024
1 parent 6f90a08 commit 177fc87
Showing 1 changed file with 1 addition and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public void executeReport(Locale locale) {
locale,
getConsoleLogger(),
getReportsDirectories(),
constructXrefTestLocation(),
linkXRef ? constructXrefLocation(xrefTestLocation, true) : null,
showSuccess);
r.render();
}
Expand Down Expand Up @@ -256,44 +256,6 @@ private List<MavenProject> getProjectsWithoutRoot() {
return result;
}

private String constructXrefTestLocation() {
String location = null;
if (linkXRef) {
File xrefTestLocation = getXrefTestLocation();

String relativePath = PathTool.getRelativePath(
getReportOutputDirectory().getAbsolutePath(), xrefTestLocation.getAbsolutePath());
if (relativePath == null || relativePath.isEmpty()) {
relativePath = ".";
}
relativePath = relativePath + "/" + xrefTestLocation.getName();
if (xrefTestLocation.exists()) {
// XRef was already generated by manual execution of a lifecycle binding
location = relativePath;
} else {
// Not yet generated - check if the report is on its way
Reporting reporting = project.getModel().getReporting();
List<ReportPlugin> reportPlugins =
reporting != null ? reporting.getPlugins() : Collections.<ReportPlugin>emptyList();
for (ReportPlugin plugin : reportPlugins) {
String artifactId = plugin.getArtifactId();
if ("maven-jxr-plugin".equals(artifactId)) {
location = relativePath;
}
}
}

if (location == null) {
getConsoleLogger().warning("Unable to locate Test Source XRef to link to - DISABLED");
}
}
return location;
}

private File getXrefTestLocation() {
return xrefTestLocation != null ? xrefTestLocation : new File(getReportOutputDirectory(), "xref-test");
}

/**
* @param locale The locale
* @param key The key to search for
Expand Down

0 comments on commit 177fc87

Please # to comment.