diff --git a/README.md b/README.md
index d6b20f3..28e0c1a 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-Contributing to [Apache Maven Wrapper Plugin](https://maven.apache.org/plugins/maven-wrapper-plugin/)
+Contributing to [Apache Maven Wrapper](https://maven.apache.org/wrapper/)
======================
[][jira]
@@ -82,7 +82,7 @@ Additional Resources
--------------------
+ [Contributing patches](https://maven.apache.org/guides/development/guide-maven-development.html#Creating_and_submitting_a_patch)
-+ [Apache Maven Artifact Resolver project page][jira]
++ [Apache Maven Wrapper project page][jira]
+ [Contributor License Agreement][cla]
+ [General GitHub documentation](https://help.github.com/)
+ [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
diff --git a/maven-wrapper-distribution/pom.xml b/maven-wrapper-distribution/pom.xml
new file mode 100644
index 0000000..890ab97
--- /dev/null
+++ b/maven-wrapper-distribution/pom.xml
@@ -0,0 +1,133 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.wrapper
+ maven-wrapper-parent
+ 3.0.3-SNAPSHOT
+
+
+ maven-wrapper-distribution
+ pom
+
+ Maven Wrapper Distribution
+ The Maven Wrapper distribution zips in 3 types: script, bin and source.
+
+
+
+
+
+ org.apache.rat
+ apache-rat-plugin
+
+
+ src/assembly/maven/bin/m2.conf
+
+ src/assembly/maven/init
+ src/assembly/maven/init.cmd
+ src/assembly/maven/run
+ src/assembly/maven/run.cmd
+ src/assembly/shared/mvnwlauncher
+ src/assembly/shared/mvnwlauncher.cmd
+ src/assembly/*/download
+ src/assembly/*/download.cmd
+
+
+
+
+ org.apache.maven.plugins
+ maven-clean-plugin
+
+ true
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 3.3.0
+
+
+ package
+
+ single
+
+
+
+
+
+ src/assembly/script.xml
+ src/assembly/bin.xml
+ src/assembly/source.xml
+
+
+
+
+
+
+
+
+ org.apache.maven.wrapper
+ maven-wrapper
+ ${project.version}
+
+
+
+
+
+ apache-release
+
+
+
+
+ net.nicoulaj.maven.plugins
+ checksum-maven-plugin
+
+
+ source-release-checksum
+
+ files
+
+
+
+
+
+
+ ${project.build.directory}
+
+ ${project.artifactId}-${project.version}-bin.zip
+ ${project.artifactId}-${project.version}-script.zip
+ ${project.artifactId}-${project.version}-source.zip
+
+
+
+ true
+
+
+
+
+
+
+
diff --git a/maven-wrapper-distribution/src/assembly/bin.xml b/maven-wrapper-distribution/src/assembly/bin.xml
new file mode 100644
index 0000000..ab9ae45
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/bin.xml
@@ -0,0 +1,85 @@
+
+
+
+
+
+ bin
+
+ zip
+
+ false
+
+
+ false
+
+ org.apache.maven.wrapper:maven-wrapper:jar:*
+
+ .mvn/wrapper
+ maven-wrapper.jar
+
+
+
+
+ src/assembly/shared/mvnwDebug.cmd
+ .
+ dos
+
+
+ src/assembly/shared/mvnwDebug
+ .
+ unix
+ 0755
+
+
+
+ src/assembly/maven/validate.cmd
+ src/assembly/maven/init.cmd
+ src/assembly/shared/mvnwlauncher.cmd
+ src/assembly/maven/run.cmd
+
+ mvnw.cmd
+ .
+ dos
+ true
+
+
+
+ src/assembly/maven/validate
+ src/assembly/maven/init
+ src/assembly/shared/mvnwlauncher
+ src/assembly/maven/run
+
+ mvnw
+ .
+ unix
+ 0755
+ true
+
+
+
+
+ src/assembly/shared/mvn
+ .mvn
+ true
+
+
+
diff --git a/maven-wrapper-distribution/src/assembly/maven/init b/maven-wrapper-distribution/src/assembly/maven/init
new file mode 100755
index 0000000..619bc4d
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/maven/init
@@ -0,0 +1,86 @@
+CLASSWORLDS_CONF="$MAVEN_HOME/bin/m2.conf"
+
+# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
+if $cygwin || $mingw ; then
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+
+ if [ ! -x "$JAVACMD" ] ; then
+ echo "The JAVA_HOME environment variable is not defined correctly, so Apache Maven cannot be started." >&2
+ echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" does not exist." >&2
+ exit 1
+ fi
+ fi
+else
+ JAVACMD="`\\unset -f command; \\command -v java`"
+
+ if [ ! -x "$JAVACMD" ] ; then
+ echo "The java(1) command does not exist in PATH nor is JAVA_HOME set, so Apache Maven cannot be started." >&2
+ exit 1
+ fi
+fi
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+(
+ basedir=`find_file_argument_basedir "$@"`
+ wdir="$basedir"
+ while [ "$wdir" != '/' ] ; do
+ if [ -d "$wdir"/.mvn ] ; then
+ basedir=$wdir
+ break
+ fi
+ wdir=`cd "$wdir/.."; pwd`
+ done
+ echo "$basedir"
+)
+}
+
+find_file_argument_basedir() {
+(
+ basedir=`pwd`
+
+ found_file_switch=0
+ for arg in "$@"; do
+ if [ ${found_file_switch} -eq 1 ]; then
+ if [ -d "${arg}" ]; then
+ basedir=`cd "${arg}" && pwd -P`
+ elif [ -f "${arg}" ]; then
+ basedir=`dirname "${arg}"`
+ basedir=`cd "$basedir" && pwd -P`
+ if [ ! -d "$basedir" ]; then
+ echo "Directory $basedir extracted from the -f/--file command-line argument ${arg} does not exist" >&2
+ exit 1
+ fi
+ else
+ echo "POM file ${arg} specified with the -f/--file command line argument does not exist" >&2
+ exit 1
+ fi
+ break
+ fi
+ if [ "$arg" = "-f" -o "$arg" = "--file" ]; then
+ found_file_switch=1
+ fi
+ done
+ echo "$basedir"
+)
+}
+
+# concatenates all lines of a file
+concat_lines() {
+ if [ -f "$1" ]; then
+ echo "`tr -s '\r\n' ' ' < "$1"`"
+ fi
+}
+
+MAVEN_PROJECTBASEDIR="`find_maven_basedir "$@"`"
+MAVEN_OPTS="`concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config"` $MAVEN_OPTS"
diff --git a/maven-wrapper-distribution/src/assembly/maven/init.cmd b/maven-wrapper-distribution/src/assembly/maven/init.cmd
new file mode 100755
index 0000000..8b1eb67
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/maven/init.cmd
@@ -0,0 +1,94 @@
+@REM ==== END VALIDATION ====
+
+:init
+
+set "CLASSWORLDS_CONF=%MAVEN_HOME%\bin\m2.conf"
+
+@REM Find the project basedir, i.e., the directory that contains the directory ".mvn".
+@REM Fallback to current working directory if not found.
+
+set "EXEC_DIR=%CD%"
+set "WDIR=%EXEC_DIR%"
+
+@REM Look for the --file switch and start the search for the .mvn directory from the specified
+@REM POM location, if supplied.
+
+set FILE_ARG=
+:arg_loop
+if "%~1" == "-f" (
+ set "FILE_ARG=%~2"
+ shift
+ goto process_file_arg
+)
+if "%~1" == "--file" (
+ set "FILE_ARG=%~2"
+ shift
+ goto process_file_arg
+)
+@REM If none of the above, skip the argument
+shift
+if not "%~1" == "" (
+ goto arg_loop
+) else (
+ goto findBaseDir
+)
+
+:process_file_arg
+if "%FILE_ARG%" == "" (
+ goto findBaseDir
+)
+if not exist "%FILE_ARG%" (
+ echo POM file "%FILE_ARG%" specified the -f/--file command-line argument does not exist >&2
+ goto error
+)
+if exist "%FILE_ARG%\*" (
+ set "POM_DIR=%FILE_ARG%"
+) else (
+ call :get_directory_from_file "%FILE_ARG%"
+)
+if not exist "%POM_DIR%" (
+ echo Directory "%POM_DIR%" extracted from the -f/--file command-line argument "%FILE_ARG%" does not exist >&2
+ goto error
+)
+set "WDIR=%POM_DIR%"
+goto findBaseDir
+
+:get_directory_from_file
+set "POM_DIR=%~dp1"
+:stripPomDir
+if not "_%POM_DIR:~-1%"=="_\" goto pomDirStripped
+set "POM_DIR=%POM_DIR:~0,-1%"
+goto stripPomDir
+:pomDirStripped
+exit /b
+
+:findBaseDir
+cd /d "%WDIR%"
+:findBaseDirLoop
+if exist "%WDIR%\.mvn" goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set "WDIR=%CD%"
+goto findBaseDirLoop
+
+:baseDirFound
+set "MAVEN_PROJECTBASEDIR=%WDIR%"
+cd /d "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+if "_%EXEC_DIR:~-1%"=="_\" set "EXEC_DIR=%EXEC_DIR:~0,-1%"
+set "MAVEN_PROJECTBASEDIR=%EXEC_DIR%"
+cd /d "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+set "jvmConfig=\.mvn\jvm.config"
+if not exist "%MAVEN_PROJECTBASEDIR%%jvmConfig%" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
diff --git a/maven-wrapper-distribution/src/assembly/maven/run b/maven-wrapper-distribution/src/assembly/maven/run
new file mode 100755
index 0000000..69535d6
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/maven/run
@@ -0,0 +1,19 @@
+# For Cygwin and MinGW, switch paths to Windows format before running java(1) command
+if $cygwin || $mingw ; then
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
+ LAUNCHER_JAR=`cygpath --windows "$LAUNCHER_JAR"`
+ CLASSWORLDS_CONF=`cygpath --windows "$CLASSWORLDS_CONF"`
+ MAVEN_HOME=`cygpath --windows "$MAVEN_HOME"`
+ MAVEN_PROJECTBASEDIR=`cygpath --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+exec "$JAVACMD" \
+ $MAVEN_OPTS \
+ $MAVEN_DEBUG_OPTS \
+ -classpath "$LAUNCHER_JAR" \
+ "-Dclassworlds.conf=$CLASSWORLDS_CONF" \
+ "-Dmaven.home=$MAVEN_HOME" \
+ "-Dlibrary.jansi.path=${MAVEN_HOME}/lib/jansi-native" \
+ "-Dmaven.multiModuleProjectDirectory=$MAVEN_PROJECTBASEDIR" \
+ $LAUNCHER_CLASS "$@"
diff --git a/maven-wrapper-distribution/src/assembly/maven/run.cmd b/maven-wrapper-distribution/src/assembly/maven/run.cmd
new file mode 100755
index 0000000..ac526f8
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/maven/run.cmd
@@ -0,0 +1,31 @@
+"%JAVACMD%" ^
+ %JVM_CONFIG_MAVEN_PROPS% ^
+ %MAVEN_OPTS% ^
+ %MAVEN_DEBUG_OPTS% ^
+ -classpath %LAUNCHER_JAR% ^
+ "-Dclassworlds.conf=%CLASSWORLDS_CONF%" ^
+ "-Dmaven.home=%MAVEN_HOME%" ^
+ "-Dlibrary.jansi.path=%MAVEN_HOME%\lib\jansi-native" ^
+ "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
+ %LAUNCHER_CLASS% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%USERPROFILE%\mavenrc_post.bat" echo Warning: The mavenrc_post.bat script is deprecated and will be removed in a future version. >&2
+if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
+if exist "%USERPROFILE%\mavenrc_post.cmd" echo Warning: The mavenrc_post.cmd script is deprecated and will be removed in a future version. >&2
+if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%"=="on" pause
+
+exit /b %ERROR_CODE%
diff --git a/maven-wrapper-distribution/src/assembly/maven/validate b/maven-wrapper-distribution/src/assembly/maven/validate
new file mode 100644
index 0000000..0d22a8b
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/maven/validate
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# -----------------------------------------------------------------------------
+# Apache Maven Startup Script
+#
+# Environment Variable Prerequisites
+#
+# JAVA_HOME (Optional) Points to a Java installation.
+# MAVEN_OPTS (Optional) Java runtime options used when Maven is executed.
+# MAVEN_SKIP_RC (Optional) Flag to disable loading of mavenrc files.
+# -----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+ if [ -f /usr/local/etc/mavenrc ] ; then
+ . /usr/local/etc/mavenrc
+ fi
+
+ if [ -f /etc/mavenrc ] ; then
+ . /etc/mavenrc
+ fi
+
+ if [ -f "$HOME/.mavenrc" ] ; then
+ . "$HOME/.mavenrc"
+ fi
+
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+mingw=false;
+case "`uname`" in
+ CYGWIN*) cygwin=true;;
+ MINGW*) mingw=true;;
+esac
+
diff --git a/maven-wrapper-distribution/src/assembly/maven/validate.cmd b/maven-wrapper-distribution/src/assembly/maven/validate.cmd
new file mode 100644
index 0000000..dc68027
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/maven/validate.cmd
@@ -0,0 +1,70 @@
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+
+@REM -----------------------------------------------------------------------------
+@REM Apache Maven Startup Script
+@REM
+@REM Environment Variable Prerequisites
+@REM
+@REM JAVA_HOME (Optional) Points to a Java installation.
+@REM MAVEN_BATCH_ECHO (Optional) Set to 'on' to enable the echoing of the batch commands.
+@REM MAVEN_BATCH_PAUSE (Optional) set to 'on' to wait for a key stroke before ending.
+@REM MAVEN_OPTS (Optional) Java runtime options used when Maven is executed.
+@REM MAVEN_SKIP_RC (Optional) Flag to disable loading of mavenrc files.
+@REM -----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%"=="on" echo %MAVEN_BATCH_ECHO%
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%"=="" goto skipRc
+if exist "%PROGRAMDATA%\mavenrc.cmd" call "%PROGRAMDATA%\mavenrc.cmd" %*
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%USERPROFILE%\mavenrc_pre.bat" echo Warning: The mavenrc_pre.bat script is deprecated and will be removed in a future version. >&2
+if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
+if exist "%USERPROFILE%\mavenrc_pre.cmd" echo Warning: The mavenrc_pre.cmd script is deprecated and will be removed in a future version. >&2
+if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
+if exist "%USERPROFILE%\mavenrc.cmd" call "%USERPROFILE%\mavenrc.cmd" %*
+:skipRc
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%"=="" goto javaHomeSet
+for %%i in (java.exe) do set "JAVACMD=%%~$PATH:i"
+goto checkJavaCmd
+
+:javaHomeSet
+set "JAVACMD=%JAVA_HOME%\bin\java.exe"
+
+if not exist "%JAVACMD%" (
+ echo The JAVA_HOME environment variable is not defined correctly, so Apache Maven cannot be started. >&2
+ echo JAVA_HOME is set to "%JAVA_HOME%", but "%%JAVA_HOME%%\bin\java.exe" does not exist. >&2
+ goto error
+)
+
+:checkJavaCmd
+if not exist "%JAVACMD%" (
+ echo The java.exe command does not exist in PATH nor is JAVA_HOME set, so Apache Maven cannot be started. >&2
+ goto error
+)
diff --git a/maven-wrapper-distribution/src/assembly/script.xml b/maven-wrapper-distribution/src/assembly/script.xml
new file mode 100644
index 0000000..3873bfb
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/script.xml
@@ -0,0 +1,77 @@
+
+
+
+
+
+ script
+
+ zip
+
+ false
+
+
+ src/assembly/shared/mvnwDebug.cmd
+ .
+ dos
+
+
+ src/assembly/shared/mvnwDebug
+ .
+ unix
+ 0755
+
+
+
+ src/assembly/maven/validate.cmd
+ src/assembly/maven/init.cmd
+ src/assembly/shared/mvnwlauncher.cmd
+ src/assembly/script/download.cmd
+ src/assembly/maven/run.cmd
+
+ mvnw.cmd
+ .
+ dos
+ true
+
+
+
+ src/assembly/maven/validate
+ src/assembly/maven/init
+ src/assembly/shared/mvnwlauncher
+ src/assembly/script/download
+ src/assembly/maven/run
+
+ mvnw
+ .
+ unix
+ 0755
+ true
+
+
+
+
+ src/assembly/shared/mvn
+ .mvn
+ true
+
+
+
diff --git a/maven-wrapper-distribution/src/assembly/script/download b/maven-wrapper-distribution/src/assembly/script/download
new file mode 100755
index 0000000..d13d81a
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/script/download
@@ -0,0 +1,51 @@
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found .mvn/wrapper/maven-wrapper.jar"
+ fi
+else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+ fi
+
+ jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar"
+
+ if [ -n "$MVNW_REPOURL" ]; then
+ jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar"
+ fi
+
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Downloading from: $jarUrl"
+ fi
+ wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
+ if $cygwin; then
+ wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+ fi
+
+ if [ `echo "${jarUrl}" | cut -c 1-4` != 'file' ] && command -v wget > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found wget ... using wget"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
+ else
+ wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
+ fi
+ elif command -v curl > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found curl ... using curl"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ curl --location -o "$wrapperJarPath" "$jarUrl" -f
+ else
+ curl --location --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+ fi
+ fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
diff --git a/maven-wrapper-distribution/src/assembly/script/download.cmd b/maven-wrapper-distribution/src/assembly/script/download.cmd
new file mode 100755
index 0000000..e4285ab
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/script/download.cmd
@@ -0,0 +1,32 @@
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+IF NOT EXIST %LAUNCHER_JAR% goto downloadWrapper
+
+if "%MVNW_VERBOSE%" == "true" ECHO Found %LAUNCHER_JAR%
+goto endWrapper
+
+:downloadWrapper
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar"
+
+if not "%MVNW_REPOURL%" == "" (
+ SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar"
+)
+if "%MVNW_VERBOSE%" == "true" (
+ echo Couldn't find %LAUNCHER_JAR%, downloading it ...
+ echo Downloading from: %DOWNLOAD_URL%
+)
+
+powershell -Command "&{"^
+ "$webclient = new-object System.Net.WebClient;"^
+ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+ "}"^
+ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%LAUNCHER_JAR%')"^
+ "}"
+if "%MVNW_VERBOSE%" == "true" (
+ echo Finished downloading %LAUNCHER_JAR%
+)
+
+:endWrapper
+@REM End of extension
+
diff --git a/src/it/projects/default/invoker.properties b/maven-wrapper-distribution/src/assembly/shared/mvn/wrapper/maven-wrapper.properties
similarity index 84%
rename from src/it/projects/default/invoker.properties
rename to maven-wrapper-distribution/src/assembly/shared/mvn/wrapper/maven-wrapper.properties
index 3125747..6fda8be 100644
--- a/src/it/projects/default/invoker.properties
+++ b/maven-wrapper-distribution/src/assembly/shared/mvn/wrapper/maven-wrapper.properties
@@ -5,14 +5,13 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-invoker.maven.version = 4+
-invoker.goals = org.apache.maven.plugins:maven-wrapper-plugin:${project.version}:wrapper
\ No newline at end of file
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${project.version}/apache-maven-${project.version}-bin.zip
diff --git a/maven-wrapper-distribution/src/assembly/shared/mvnwDebug b/maven-wrapper-distribution/src/assembly/shared/mvnwDebug
new file mode 100644
index 0000000..3e66a1a
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/shared/mvnwDebug
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# -----------------------------------------------------------------------------
+# Apache Maven Debug Script
+#
+# Environment Variable Prerequisites
+#
+# JAVA_HOME (Optional) Points to a Java installation.
+# MAVEN_OPTS (Optional) Java runtime options used when Maven is executed.
+# MAVEN_SKIP_RC (Optional) Flag to disable loading of mavenrc files.
+# MAVEN_DEBUG_ADDRESS (Optional) Set the debug address. Default value is localhost:8000
+# -----------------------------------------------------------------------------
+
+MAVEN_DEBUG_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${MAVEN_DEBUG_ADDRESS:-localhost:8000}"
+
+echo Preparing to execute Maven Wrapper in debug mode
+
+env MAVEN_OPTS="$MAVEN_OPTS" MAVEN_DEBUG_OPTS="$MAVEN_DEBUG_OPTS" "`dirname "$0"`/mvnw" "$@"
diff --git a/maven-wrapper-distribution/src/assembly/shared/mvnwDebug.cmd b/maven-wrapper-distribution/src/assembly/shared/mvnwDebug.cmd
new file mode 100644
index 0000000..52368be
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/shared/mvnwDebug.cmd
@@ -0,0 +1,44 @@
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+
+@REM -----------------------------------------------------------------------------
+@REM Apache Maven Debug Script
+@REM
+@REM Environment Variable Prerequisites
+@REM
+@REM JAVA_HOME (Optional) Points to a Java installation.
+@REM MAVEN_BATCH_ECHO (Optional) Set to 'on' to enable the echoing of the batch commands.
+@REM MAVEN_BATCH_PAUSE (Optional) set to 'on' to wait for a key stroke before ending.
+@REM MAVEN_OPTS (Optional) Java runtime options used when Maven is executed.
+@REM MAVEN_SKIP_RC (Optional) Flag to disable loading of mavenrc files.
+@REM MAVEN_DEBUG_ADDRESS (Optional) Set the debug address. Default value is localhost:8000
+@REM -----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%"=="on" echo %MAVEN_BATCH_ECHO%
+
+@setlocal
+
+IF "%MAVEN_DEBUG_ADDRESS%"=="" @set MAVEN_DEBUG_ADDRESS=localhost:8000
+
+@set MAVEN_DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%MAVEN_DEBUG_ADDRESS%
+
+@call "%~dp0"mvnw.cmd %*
diff --git a/maven-wrapper-distribution/src/assembly/shared/mvnwlauncher b/maven-wrapper-distribution/src/assembly/shared/mvnwlauncher
new file mode 100755
index 0000000..3fbd254
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/shared/mvnwlauncher
@@ -0,0 +1,3 @@
+LAUNCHER_JAR="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
+LAUNCHER_CLASS=org.apache.maven.wrapper.MavenWrapperMain
+
diff --git a/maven-wrapper-distribution/src/assembly/shared/mvnwlauncher.cmd b/maven-wrapper-distribution/src/assembly/shared/mvnwlauncher.cmd
new file mode 100755
index 0000000..193db12
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/shared/mvnwlauncher.cmd
@@ -0,0 +1,3 @@
+set LAUNCHER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set LAUNCHER_CLASS=org.apache.maven.wrapper.MavenWrapperMain
+
diff --git a/maven-wrapper-distribution/src/assembly/source.xml b/maven-wrapper-distribution/src/assembly/source.xml
new file mode 100644
index 0000000..8218cfb
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/source.xml
@@ -0,0 +1,82 @@
+
+
+
+
+
+ source
+
+ zip
+
+ false
+
+
+ src/assembly/shared/mvnwDebug.cmd
+ .
+ dos
+
+
+ src/assembly/shared/mvnwDebug
+ .
+ unix
+ 0755
+
+
+
+ src/assembly/maven/validate.cmd
+ src/assembly/maven/init.cmd
+ src/assembly/shared/mvnwlauncher.cmd
+ src/assembly/source/download.cmd
+ src/assembly/maven/run.cmd
+
+ mvnw.cmd
+ .
+ dos
+ true
+
+
+
+ src/assembly/maven/validate
+ src/assembly/maven/init
+ src/assembly/shared/mvnwlauncher
+ src/assembly/source/download
+ src/assembly/maven/run
+
+ mvnw
+ .
+ unix
+ 0755
+ true
+
+
+
+
+ src/assembly/shared/mvn
+ .mvn
+ true
+
+
+ src/assembly/source/mvn
+ .mvn
+ true
+
+
+
diff --git a/maven-wrapper-distribution/src/assembly/source/download b/maven-wrapper-distribution/src/assembly/source/download
new file mode 100644
index 0000000..30cf5e4
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/source/download
@@ -0,0 +1,34 @@
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found .mvn/wrapper/maven-wrapper.jar"
+ fi
+else
+ javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
+ # For Cygwin, switch paths to Windows format before running javac
+ if $cygwin; then
+ javaClass=`cygpath --path --windows "$javaClass"`
+ fi
+ if [ -e "$javaClass" ]; then
+ if [ ! -e "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Compiling MavenWrapperDownloader.java ..."
+ fi
+ # Compiling the Java class
+ ("$JAVA_HOME/bin/javac" "$javaClass")
+ fi
+ if [ -e "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ # Running the downloader
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Running MavenWrapperDownloader.java ..."
+ fi
+ ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+ fi
+ fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
diff --git a/maven-wrapper-distribution/src/assembly/source/download.cmd b/maven-wrapper-distribution/src/assembly/source/download.cmd
new file mode 100644
index 0000000..40d8451
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/source/download.cmd
@@ -0,0 +1,21 @@
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+
+SET javaClass="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\MavenWrapperDownloader.java"
+IF EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\MavenDownloader.class" goto :runDownloader
+
+if "%MVNW_VERBOSE%" == "true" echo - Compiling MavenWrapperDownloader.java ...
+
+@REM Compiling the Java class
+"%JAVA_HOME%\bin\javac" %javaClass%
+
+:runDownloader
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\MavenWrapperDownloader.class" goto endWrapper
+
+if "%MVNW_VERBOSE%" == "true" echo - Running MavenWrapperDownloader.class ...
+@REM Running the downloader
+"%JAVA_HOME%\bin\java" -cp "%MAVEN_PROJECTBASEDIR%\.mvn\wrapper" MavenWrapperDownloader "%MAVEN_PROJECTBASEDIR%"
+
+:endWrapper
+@REM End of extension
+
diff --git a/maven-wrapper-distribution/src/assembly/source/mvn/wrapper/MavenWrapperDownloader.java b/maven-wrapper-distribution/src/assembly/source/mvn/wrapper/MavenWrapperDownloader.java
new file mode 100644
index 0000000..490edb4
--- /dev/null
+++ b/maven-wrapper-distribution/src/assembly/source/mvn/wrapper/MavenWrapperDownloader.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2007-present the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.Authenticator;
+import java.net.PasswordAuthentication;
+import java.net.URL;
+import java.nio.channels.Channels;
+import java.nio.channels.ReadableByteChannel;
+import java.util.Objects;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+ private static final String WRAPPER_VERSION = "${project.version}";
+
+ /**
+ * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+ */
+ private static final String DEFAULT_DOWNLOAD_PATH = "/org/apache/maven/wrapper/maven-wrapper/"
+ + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+ /**
+ * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+ * use instead of the default one.
+ */
+ private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+ ".mvn/wrapper/maven-wrapper.properties";
+
+ /**
+ * Path where the maven-wrapper.jar will be saved to.
+ */
+ private static final String MAVEN_WRAPPER_JAR_PATH =
+ ".mvn/wrapper/maven-wrapper.jar";
+
+ /**
+ * Name of the property which should be used to override the default download url for the wrapper.
+ */
+ private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+ public static void main( String args[] ) {
+ System.out.println("- Downloader started");
+ File baseDirectory = new File(args[0]);
+ System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+ // If the maven-wrapper.properties exists, read it and check if it contains a custom
+ // wrapperUrl parameter.
+ File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+
+ String url = null;
+
+ String repoUrl = System.getenv( "MVNW_REPOURL" );
+ if ( repoUrl != null )
+ {
+ url = repoUrl + DEFAULT_DOWNLOAD_PATH;
+ }
+ else if ( mavenWrapperPropertyFile.exists() )
+ {
+ Properties mavenWrapperProperties = new Properties();
+ try ( InputStream mavenWrapperPropertyFileInputStream = new FileInputStream( mavenWrapperPropertyFile ) )
+ {
+ mavenWrapperProperties.load( mavenWrapperPropertyFileInputStream );
+ url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+ }
+ catch ( IOException e )
+ {
+ System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+ }
+ }
+
+ if ( url == null )
+ {
+ url = "https://repo.maven.apache.org/maven2" + DEFAULT_DOWNLOAD_PATH;
+ }
+ System.out.println("- Downloading from: " + url);
+
+ File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+ if(!outputFile.getParentFile().exists()) {
+ if(!outputFile.getParentFile().mkdirs()) {
+ System.out.println(
+ "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+ }
+ }
+ System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+ try {
+ downloadFileFromURL(url, outputFile);
+ System.out.println("Done");
+ System.exit(0);
+ } catch (Throwable e) {
+ System.out.println("- Error downloading");
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+
+ private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+ if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+ String username = System.getenv("MVNW_USERNAME");
+ char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+ Authenticator.setDefault(new Authenticator() {
+ @Override
+ protected PasswordAuthentication getPasswordAuthentication() {
+ return new PasswordAuthentication(username, password);
+ }
+ });
+ }
+ URL website = new URL(urlString);
+ try ( ReadableByteChannel rbc = Channels.newChannel( website.openStream() );
+ FileOutputStream fos = new FileOutputStream(destination) )
+ {
+ fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+ }
+ }
+
+}
diff --git a/maven-wrapper-distribution/src/site/apt/index.apt.vm b/maven-wrapper-distribution/src/site/apt/index.apt.vm
new file mode 100644
index 0000000..7592f68
--- /dev/null
+++ b/maven-wrapper-distribution/src/site/apt/index.apt.vm
@@ -0,0 +1,58 @@
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+ -----
+ ${project.name}
+ -----
+ Hervé Boutemy
+ -----
+ 2021-10-10
+ -----
+
+${project.name}
+
+ ${project.description}
+
+ Distributions types share the same base structure:
+
+----
+mvnw
+mvnw.cmd
+mvnwDebug
+mvnwDebug.cmd
+.mvn/wrapper/maven-wrapper.properties
+----
+
+ but every distribution has specific <<>>/<<>> scripts to manage different strategies to get {{{../maven-wrapper/}<<>>}}:
+
+ - <<