protected String constructXrefLocation()

in src/main/java/org/apache/maven/reporting/AbstractMavenReport.java [490:520]


    protected String constructXrefLocation(File location, boolean test) {
        String constructedLocation = null;
        File xrefLocation = getXrefLocation(location, 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
            constructedLocation = 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)) {
                    constructedLocation = relativePath;
                }
            }
        }

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