Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ under the License.
<resolverVersion>1.4.1</resolverVersion>
<checkstyleVersion>9.3</checkstyleVersion>
<slf4jVersion>1.7.36</slf4jVersion>
<doxiaVersion>2.0.0-M12</doxiaVersion>
<doxiaSitetoolsVersion>2.0.0-M19</doxiaSitetoolsVersion>
<doxiaVersion>2.0.0</doxiaVersion>
<doxiaSitetoolsVersion>2.0.0</doxiaSitetoolsVersion>
<sitePluginVersion>3.20.0</sitePluginVersion>
<jxrPluginVersion>3.4.0</jxrPluginVersion>
<jxrPluginVersion>3.5.0</jxrPluginVersion>
<project.build.outputTimestamp>2024-08-19T15:41:42Z</project.build.outputTimestamp>
</properties>

Expand Down Expand Up @@ -132,12 +132,12 @@ under the License.
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
<version>4.0.0-M12</version>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>4.0.0-M15</version>
<version>4.0.0</version>
</dependency>

<!-- doxia -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginManagement;
import org.apache.maven.model.ReportPlugin;
import org.apache.maven.model.Reporting;
import org.apache.maven.model.Resource;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugins.annotations.Component;
Expand Down Expand Up @@ -489,45 +487,6 @@ protected List<MavenProject> getReactorProjects() {
return reactorProjects;
}

protected String constructXrefLocation(boolean test, boolean haveResults) {
String location = null;
if (linkXRef) {
File xrefLocation = getXrefLocation(test);

String relativePath = PathTool.getRelativePath(
getReportOutputDirectory().getAbsolutePath(), xrefLocation.getAbsolutePath());
if (relativePath == null || relativePath.isEmpty()) {
relativePath = ".";
}
relativePath = relativePath + "/" + xrefLocation.getName();
if (xrefLocation.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) || "jxr-maven-plugin".equals(artifactId)) {
location = relativePath;
}
}
}

if (location == null && haveResults) {
getLog().warn("Unable to locate" + (test ? " Test" : "") + " Source XRef to link to - DISABLED");
}
}
return location;
}

protected File getXrefLocation(boolean test) {
File location = test ? xrefTestLocation : xrefLocation;
return location != null ? location : new File(getReportOutputDirectory(), test ? "xref-test" : "xref");
}

/** {@inheritDoc} */
public void executeReport(Locale locale) throws MavenReportException {
checkDeprecatedParameterUsage(sourceDirectory, "sourceDirectory", "sourceDirectories");
Expand Down Expand Up @@ -573,16 +532,15 @@ public void executeReport(Locale locale) throws MavenReportException {

CheckstyleResults results = checkstyleExecutor.executeCheckstyle(request);

boolean haveResults = results.getFileCount() > 0;
CheckstyleReportRenderer r = new CheckstyleReportRenderer(
getSink(),
i18n,
locale,
project,
siteTool,
effectiveConfigLocation,
constructXrefLocation(false, haveResults),
constructXrefLocation(true, haveResults),
linkXRef ? constructXrefLocation(xrefLocation, false) : null,
linkXRef ? constructXrefLocation(xrefTestLocation, true) : null,
linkXRef ? getTestSourceDirectories() : Collections.emptyList(),
enableRulesSummary,
enableSeveritySummary,
Expand Down