private Wagon getWagon()

in src/main/java/org/apache/maven/plugins/site/deploy/AbstractDeployMojo.java [275:290]


    private Wagon getWagon(final Repository repository) throws MojoExecutionException {
        String protocol = repository.getProtocol();
        if (protocol == null) {
            throw new MojoExecutionException("Unspecified protocol");
        }
        try {
            Wagon wagon = container.lookup(Wagon.class, protocol.toLowerCase(Locale.ROOT));
            if (!wagon.supportsDirectoryCopy()) {
                throw new MojoExecutionException(
                        "Wagon protocol '" + repository.getProtocol() + "' doesn't support directory copying");
            }
            return wagon;
        } catch (ComponentLookupException e) {
            throw new MojoExecutionException("Cannot find wagon which supports the requested protocol: " + protocol, e);
        }
    }