public void execute()

in core-it-support/core-it-plugins/maven-it-plugin-uses-wagon/src/main/java/org/apache/maven/plugin/coreit/LookupWagonMojo.java [71:113]


    public void execute() throws MojoExecutionException, MojoFailureException {
        Properties loaderProperties = new Properties();

        if (urls != null) {
            for (int i = 0; i < urls.length; i++) {
                String url = urls[i];
                getLog().info("[MAVEN-CORE-IT-LOG] Looking up wagon for URL " + url);

                try {
                    Repository repo = new Repository("repo-" + i, url);
                    Wagon wagon = wagonManager.getWagon(repo);
                    getLog().info("[MAVEN-CORE-IT-LOG]   " + wagon);

                    loaderProperties.setProperty(url + ".hash", Integer.toString(System.identityHashCode(wagon)));
                    loaderProperties.setProperty(
                            url + ".class", wagon.getClass().getName());
                } catch (Exception e) {
                    getLog().warn("[MAVEN-CORE-IT-LOG] Failed to look up wagon for URL " + url, e);
                }
            }
        }

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

        OutputStream out = null;
        try {
            outputFile.getParentFile().mkdirs();
            out = new FileOutputStream(outputFile);
            loaderProperties.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);
    }