protected String determineRepoUrl()

in maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java [385:410]


    protected String determineRepoUrl(String envRepoUrl, Settings settings) {

        if (envRepoUrl != null && !envRepoUrl.trim().isEmpty() && envRepoUrl.length() > 4) {
            String repoUrl = envRepoUrl.trim();

            if (repoUrl.endsWith("/")) {
                repoUrl = repoUrl.substring(0, repoUrl.length() - 1);
            }

            getLog().debug("Using repo URL from " + MVNW_REPOURL + " environment variable.");

            return repoUrl;
        }

        // otherwise mirror from settings
        if (settings.getMirrors() != null && !settings.getMirrors().isEmpty()) {
            for (Mirror current : settings.getMirrors()) {
                if ("*".equals(current.getMirrorOf())) {
                    getLog().debug("Using repo URL from * mirror in settings file.");
                    return current.getUrl();
                }
            }
        }

        return DEFAULT_REPOURL;
    }