Basta invocar o maven-wrapper-plugin
. Peguei do tutorial da Baeldung a seguinte linha:
$ mvn -N io.takari:maven:wrapper -Dmaven=3.5.2
....
[INFO] --- maven:0.7.6:wrapper (default-cli) @ project ---
[INFO]
[INFO] Maven Wrapper version 0.5.5 has been successfully set up for your project.
[INFO] Using Apache Maven: 3.5.2
[INFO] Repo URL in properties file: https://repo.maven.apache.org/maven2
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.722 s
[INFO] Finished at: 2019-11-13T16:01:22-03:00
[INFO] Final Memory: 7M/153M
[INFO] ------------------------------------------------------------------------
Com isso, foi alterada a versão do mvnw
para 3.5.2
. O git diff
identifica essa alteração também:
$ git diff
diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar
index 5fd4d50..0d5e649 100644
Binary files a/.mvn/wrapper/maven-wrapper.jar and b/.mvn/wrapper/maven-wrapper.jar differ
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
index c954cec..cc805cc 100644
--- a/.mvn/wrapper/maven-wrapper.properties
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -1 +1,2 @@
-distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar
... [outras coisas do meu repositório que foram alteradas] ...