in maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java [178:193]
public void execute() throws MojoExecutionException, MojoFailureException {
if (mvndVersion != null && mvndVersion.length() > 0 && !"only-script".equals(distributionType)) {
throw new MojoExecutionException("maven-wrapper with type=" + distributionType
+ " cannot work with mvnd, please set type to '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);
final Path wrapperDir = createDirectories(basedir.toPath().resolve(".mvn/wrapper"));
cleanup(wrapperDir);
unpack(artifact, basedir.toPath());
replaceProperties(wrapperVersion, wrapperDir);
}