public void execute()

in core-it-support/core-it-plugins/maven-it-plugin-core-stubs/maven-resources-plugin/src/main/java/org/apache/maven/plugin/coreit/ResourcesMojo.java [70:103]


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

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

        File outputFile = new File(pathname);
        if (!outputFile.isAbsolute()) {
            outputFile = new File(project.getBasedir(), pathname).getAbsoluteFile();
        }

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

        try {
            outputFile.getParentFile().mkdirs();

            if (message != null && message.length() > 0) {
                getLog().info("[MAVEN-CORE-IT-LOG]   " + message);

                try (OutputStreamWriter writer =
                        new OutputStreamWriter(new FileOutputStream(outputFile, true), "UTF-8")) {
                    writer.write(message);
                    writer.write("\n");
                }
            } else {
                outputFile.createNewFile();
            }
        } catch (IOException e) {
            throw new MojoExecutionException("Output file could not be created: " + pathname, e);
        }

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