public void execute()

in core-it-support/core-it-plugins/maven-it-plugin-toolchain/src/main/java/org/apache/maven/plugin/coreit/FindToolMojo.java [74:106]


    public void execute() throws MojoExecutionException {
        Toolchain toolchain = toolchainManager.getToolchainFromBuildContext(type, session);

        getLog().info("[MAVEN-CORE-IT-LOG] Toolchain in session: " + toolchain);

        Properties properties = new Properties();

        if (toolchain != null) {
            properties.setProperty("toolchain.type", toolchain.getType());

            String path = toolchain.findTool(tool);
            if (path != null) {
                properties.setProperty("tool." + tool, path);
            }
        }

        OutputStream out = null;
        try {
            outputFile.getParentFile().mkdirs();
            out = new FileOutputStream(outputFile);
            properties.store(out, "MAVEN-CORE-IT-LOG");
        } catch (IOException e) {
            throw new MojoExecutionException(e.getMessage(), e);
        } finally {
            if (out != null) {
                try {
                    out.close();
                } catch (IOException e) {
                    // ignore
                }
            }
        }
    }