public void execute()

in core-it-support/core-it-plugins/maven-it-plugin-site/src/main/java/org/apache/maven/plugin/coreit/InfoReport.java [77:117]


    public void execute() throws MojoExecutionException, MojoFailureException {
        getLog().info("[MAVEN-CORE-IT-LOG] Using output file path: " + infoFile);

        if (infoFile == null || infoFile.length() <= 0) {
            throw new MojoFailureException("Path name for output file has not been specified");
        }

        File outputFile = new File(outputDirectory, infoFile);
        if (!outputFile.isAbsolute()) {
            outputFile = new File(new File(basedir, outputDirectory.getPath()), infoFile).getAbsoluteFile();
        }

        Properties props = new Properties();
        props.setProperty("site.output.directory", outputDirectory.getPath());
        if (locale != null) {
            props.setProperty("locale.language", locale.getLanguage());
            props.setProperty("locale.country", locale.getCountry());
            props.setProperty("locale.variant", locale.getVariant());
        }

        getLog().info("[MAVEN-CORE-IT-LOG] Creating output file: " + outputFile);

        OutputStream out = null;
        try {
            outputFile.getParentFile().mkdirs();
            out = new FileOutputStream(outputFile);
            props.store(out, "MAVEN-CORE-IT-LOG");
        } catch (IOException e) {
            throw new MojoExecutionException("Output file could not be created: " + outputFile, e);
        } finally {
            if (out != null) {
                try {
                    out.close();
                } catch (IOException e) {
                    // just ignore
                }
            }
        }

        getLog().info("[MAVEN-CORE-IT-LOG] Created output file: " + outputFile);
    }