This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch doxia-2.0.0-ga
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit 177fc87b744e6619a309df104a0083bebc65baf5
Author: Michael Osipov <micha...@apache.org>
AuthorDate: Sun Oct 20 20:12:42 2024 +0200

    Fix
---
 .../surefire/report/AbstractSurefireReport.java    | 40 +---------------------
 1 file changed, 1 insertion(+), 39 deletions(-)

diff --git 
a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReport.java
 
b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReport.java
index 7025da05a..d4d721e85 100644
--- 
a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReport.java
+++ 
b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReport.java
@@ -154,7 +154,7 @@ public abstract class AbstractSurefireReport extends 
AbstractMavenReport {
                 locale,
                 getConsoleLogger(),
                 getReportsDirectories(),
-                constructXrefTestLocation(),
+                linkXRef ? constructXrefLocation(xrefTestLocation, true) : 
null,
                 showSuccess);
         r.render();
     }
@@ -256,44 +256,6 @@ public abstract class AbstractSurefireReport extends 
AbstractMavenReport {
         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

Reply via email to