public void execute()

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


    public void execute() throws MojoExecutionException {
        final Path baseDir = Paths.get(session.getRequest().getBaseDirectory());
        final Path wrapperDir = baseDir.resolve(WRAPPER_DIR);

        if (distributionType == null) {
            distributionType = determineDistributionType(wrapperDir);
        }

        if (mvndVersion != null && mvndVersion.length() > 0 && !TYPE_ONLY_SCRIPT.equals(distributionType)) {
            throw new MojoExecutionException("maven-wrapper with type=" + distributionType
                    + " cannot work with mvnd, please set type to '" + TYPE_ONLY_SCRIPT + "'.");
        }

        mavenVersion = getVersion(mavenVersion, Maven.class, "org.apache.maven/maven-core");
        String wrapperVersion = getVersion(null, this.getClass(), "org.apache.maven.plugins/maven-wrapper-plugin");

        final Artifact artifact = downloadWrapperDistribution(wrapperVersion);

        createDirectories(wrapperDir);
        cleanup(wrapperDir);
        unpack(artifact, baseDir);
        replaceProperties(wrapperVersion, wrapperDir);
    }