private void copyRequiredResources()

in maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java [292:328]


    private void copyRequiredResources(File targetDirectory) {
        if (stylesheet != null && !stylesheet.isEmpty()) {
            File stylesheetFile = new File(stylesheet);
            File targetStylesheetFile = new File(targetDirectory, "stylesheet.css");

            try {
                if (stylesheetFile.isAbsolute()) {
                    FileUtils.copyFile(stylesheetFile, targetStylesheetFile);
                } else {
                    URL stylesheetUrl = this.getClass().getClassLoader().getResource(stylesheet);
                    FileUtils.copyURLToFile(stylesheetUrl, targetStylesheetFile);
                }
            } catch (IOException e) {
                getLog().warn("An error occured while copying the stylesheet to the target directory", e);
            }
        } else {
            if (javadocTemplatesVersion.isAtLeast("1.8")) {
                copyResources(targetDirectory, "jdk8/", "stylesheet.css");
            } else if (javadocTemplatesVersion.isAtLeast("1.7")) {
                String[] jdk7Resources = {
                    "stylesheet.css",
                    "resources/background.gif",
                    "resources/tab.gif",
                    "resources/titlebar.gif",
                    "resources/titlebar_end.gif"
                };
                copyResources(targetDirectory, "jdk7/", jdk7Resources);
            } else if (javadocTemplatesVersion.isAtLeast("1.6")) {
                copyResources(targetDirectory, "jdk6/", "stylesheet.css");
            } else if (javadocTemplatesVersion.isAtLeast("1.4")) {
                copyResources(targetDirectory, "jdk4/", "stylesheet.css");
            } else {
                // Fallback to the original stylesheet
                copyResources(targetDirectory, "", "stylesheet.css");
            }
        }
    }