If your project is not allowed to contain binary files like this, you can
use the source distribution of the maven wrapper which adds a file
.mvn/wrapper/MavenWrapperDownloader.java file instead:
mvn wrapper:wrapper -Dtype=source
You can also choose to opt out of all additional resources except the wrapper scripts:
mvn wrapper:wrapper -Dtype=script
Another type is the lite implementation of mvnw/mvnw.cmd scripts which download the maven directly
via wget or curl on *nix, or PowerShell on Windows, then call the original mvn/mvn.cmd
scripts of the downloaded maven distribution.
This type does not use maven-wrapper.jar nor MavenWrapperDownloader.java, only the wrapper scripts are required.
This is the default type being installed, when no type parameter is specified.
mvn wrapper:wrapper -Dtype=only-script
If the JAR is not found to be available by the scripts they will attempt to
download the file from the URL specified in
.mvn/wrapper/maven-wrapper.properties under wrapperUrl and put it in place.
The download is attempted via curl, wget and, as last resort, by compiling the
.mvn/wrapper/MavenWrapperDownloader.java file and executing the resulting
class.
If your Maven repository is password protected you can specify your username via
the environment variable MVNW_USERNAME and the password via the environment
variable MVNW_PASSWORD.