diff --git a/apache-maven/src/assembly/component.xml b/apache-maven/src/assembly/component.xml index 6d9809c4b5..e7dc464b23 100644 --- a/apache-maven/src/assembly/component.xml +++ b/apache-maven/src/assembly/component.xml @@ -99,34 +99,4 @@ under the License. lib - - - - - src/assembly/shared/validate.cmd - src/assembly/shared/mvnvalidate.cmd - src/assembly/shared/init.cmd - src/assembly/shared/mvnlauncher.cmd - src/assembly/shared/run.cmd - - mvn.cmd - bin - dos - true - - - - src/assembly/shared/validate - src/assembly/shared/mvnvalidate - src/assembly/shared/init - src/assembly/shared/mvnlauncher - src/assembly/shared/run - - mvn - bin - unix - 0755 - true - - diff --git a/apache-maven/src/assembly/maven/bin/mvn b/apache-maven/src/assembly/maven/bin/mvn new file mode 100644 index 0000000000..eb999d5d58 --- /dev/null +++ b/apache-maven/src/assembly/maven/bin/mvn @@ -0,0 +1,192 @@ +#!/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_ARGS (Optional) Arguments passed to Maven before CLI arguments. +# 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 + +## resolve links - $0 may be a link to Maven's home +PRG="$0" + +# need this for relative symlinks +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi +done + +saveddir=`pwd` + +MAVEN_HOME=`dirname "$PRG"`/.. + +# make it fully qualified +MAVEN_HOME=`cd "$MAVEN_HOME" && pwd` + +cd "$saveddir" + +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 : + do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + if [ "$wdir" = '/' ] ; then + 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="$MAVEN_OPTS `concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config"`" +LAUNCHER_JAR=`echo "$MAVEN_HOME"/boot/plexus-classworlds-*.jar` +LAUNCHER_CLASS=org.codehaus.plexus.classworlds.launcher.Launcher + +# 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 \ + --enable-native-access=ALL-UNNAMED \ + -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 \ + $MAVEN_ARGS \ + "$@" diff --git a/apache-maven/src/assembly/maven/bin/mvn.cmd b/apache-maven/src/assembly/maven/bin/mvn.cmd new file mode 100644 index 0000000000..f39bdce355 --- /dev/null +++ b/apache-maven/src/assembly/maven/bin/mvn.cmd @@ -0,0 +1,209 @@ +@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_ARGS (Optional) Arguments passed to Maven before CLI arguments. +@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 +) +:chkMHome +set "MAVEN_HOME=%~dp0" +set "MAVEN_HOME=%MAVEN_HOME:~0,-5%" +if "%MAVEN_HOME%"=="" goto error + +:checkMCmd +if not exist "%MAVEN_HOME%\bin\mvn.cmd" goto error + +@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%" +set "WDIR=%CD%" +:findBaseDirLoop +if exist ".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 + +if not exist "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadJvmConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_OPTS=!JVM_CONFIG_MAVEN_OPTS! %%a +@endlocal & set MAVEN_OPTS=%MAVEN_OPTS% %JVM_CONFIG_MAVEN_OPTS% + +:endReadJvmConfig + +for %%i in ("%MAVEN_HOME%"\boot\plexus-classworlds-*) do set LAUNCHER_JAR="%%i" +set LAUNCHER_CLASS=org.codehaus.plexus.classworlds.launcher.Launcher + +"%JAVACMD%" ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + --enable-native-access=ALL-UNNAMED ^ + -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% ^ + %MAVEN_ARGS% ^ + %* +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/apache-maven/src/assembly/shared/init b/apache-maven/src/assembly/shared/init deleted file mode 100755 index 2af4b989cd..0000000000 --- a/apache-maven/src/assembly/shared/init +++ /dev/null @@ -1,90 +0,0 @@ -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 : - do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - if [ "$wdir" = '/' ] ; then - 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="$MAVEN_OPTS `concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config"`" diff --git a/apache-maven/src/assembly/shared/init.cmd b/apache-maven/src/assembly/shared/init.cmd deleted file mode 100755 index e41e093b22..0000000000 --- a/apache-maven/src/assembly/shared/init.cmd +++ /dev/null @@ -1,94 +0,0 @@ -@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%" -set "WDIR=%CD%" -:findBaseDirLoop -if exist ".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 - -if not exist "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadJvmConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_OPTS=!JVM_CONFIG_MAVEN_OPTS! %%a -@endlocal & set MAVEN_OPTS=%MAVEN_OPTS% %JVM_CONFIG_MAVEN_OPTS% - -:endReadJvmConfig - diff --git a/apache-maven/src/assembly/shared/mvnlauncher b/apache-maven/src/assembly/shared/mvnlauncher deleted file mode 100644 index 830f067cca..0000000000 --- a/apache-maven/src/assembly/shared/mvnlauncher +++ /dev/null @@ -1,3 +0,0 @@ -LAUNCHER_JAR=`echo "$MAVEN_HOME"/boot/plexus-classworlds-*.jar` -LAUNCHER_CLASS=org.codehaus.plexus.classworlds.launcher.Launcher - diff --git a/apache-maven/src/assembly/shared/mvnlauncher.cmd b/apache-maven/src/assembly/shared/mvnlauncher.cmd deleted file mode 100644 index 567e81226c..0000000000 --- a/apache-maven/src/assembly/shared/mvnlauncher.cmd +++ /dev/null @@ -1,3 +0,0 @@ -for %%i in ("%MAVEN_HOME%"\boot\plexus-classworlds-*) do set LAUNCHER_JAR="%%i" -set LAUNCHER_CLASS=org.codehaus.plexus.classworlds.launcher.Launcher - diff --git a/apache-maven/src/assembly/shared/mvnvalidate b/apache-maven/src/assembly/shared/mvnvalidate deleted file mode 100644 index ca93607c02..0000000000 --- a/apache-maven/src/assembly/shared/mvnvalidate +++ /dev/null @@ -1,23 +0,0 @@ -## resolve links - $0 may be a link to Maven's home -PRG="$0" - -# need this for relative symlinks -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi -done - -saveddir=`pwd` - -MAVEN_HOME=`dirname "$PRG"`/.. - -# make it fully qualified -MAVEN_HOME=`cd "$MAVEN_HOME" && pwd` - -cd "$saveddir" - diff --git a/apache-maven/src/assembly/shared/mvnvalidate.cmd b/apache-maven/src/assembly/shared/mvnvalidate.cmd deleted file mode 100644 index cf1b2dda8a..0000000000 --- a/apache-maven/src/assembly/shared/mvnvalidate.cmd +++ /dev/null @@ -1,8 +0,0 @@ -:chkMHome -set "MAVEN_HOME=%~dp0" -set "MAVEN_HOME=%MAVEN_HOME:~0,-5%" -if "%MAVEN_HOME%"=="" goto error - -:checkMCmd -if not exist "%MAVEN_HOME%\bin\mvn.cmd" goto error - diff --git a/apache-maven/src/assembly/shared/run b/apache-maven/src/assembly/shared/run deleted file mode 100755 index 4ecc6e5819..0000000000 --- a/apache-maven/src/assembly/shared/run +++ /dev/null @@ -1,22 +0,0 @@ -# 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 \ - --enable-native-access=ALL-UNNAMED \ - -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 \ - $MAVEN_ARGS \ - "$@" diff --git a/apache-maven/src/assembly/shared/run.cmd b/apache-maven/src/assembly/shared/run.cmd deleted file mode 100755 index 69b6c3b4f4..0000000000 --- a/apache-maven/src/assembly/shared/run.cmd +++ /dev/null @@ -1,33 +0,0 @@ -"%JAVACMD%" ^ - %MAVEN_OPTS% ^ - %MAVEN_DEBUG_OPTS% ^ - --enable-native-access=ALL-UNNAMED ^ - -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% ^ - %MAVEN_ARGS% ^ - %* -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/apache-maven/src/assembly/shared/validate b/apache-maven/src/assembly/shared/validate deleted file mode 100644 index 449e23b24c..0000000000 --- a/apache-maven/src/assembly/shared/validate +++ /dev/null @@ -1,54 +0,0 @@ -#!/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_ARGS (Optional) Arguments passed to Maven before CLI arguments. -# 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/apache-maven/src/assembly/shared/validate.cmd b/apache-maven/src/assembly/shared/validate.cmd deleted file mode 100644 index 7920741c6c..0000000000 --- a/apache-maven/src/assembly/shared/validate.cmd +++ /dev/null @@ -1,71 +0,0 @@ -@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_ARGS (Optional) Arguments passed to Maven before CLI arguments. -@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/api/maven-api-core/src/main/java/org/apache/maven/api/Lifecycle.java b/api/maven-api-core/src/main/java/org/apache/maven/api/Lifecycle.java index c7612a1d84..9fdabb2854 100644 --- a/api/maven-api-core/src/main/java/org/apache/maven/api/Lifecycle.java +++ b/api/maven-api-core/src/main/java/org/apache/maven/api/Lifecycle.java @@ -49,7 +49,6 @@ public interface Lifecycle extends ExtensibleEnum { String CLEAN = "clean"; String DEFAULT = "default"; String SITE = "site"; - String WRAPPER = "wrapper"; // ====================== // Phase qualifiers diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLifecycleRegistry.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLifecycleRegistry.java index 6a401504c5..9ea3be92ec 100644 --- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLifecycleRegistry.java +++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLifecycleRegistry.java @@ -89,7 +89,7 @@ public class DefaultLifecycleRegistry implements LifecycleRegistry { @Inject public DefaultLifecycleRegistry(List providers) { List p = new ArrayList<>(providers); - p.add(() -> List.of(new CleanLifecycle(), new DefaultLifecycle(), new SiteLifecycle(), new WrapperLifecycle())); + p.add(() -> List.of(new CleanLifecycle(), new DefaultLifecycle(), new SiteLifecycle())); this.providers = p; // validate lifecycle for (Lifecycle lifecycle : this) { @@ -187,8 +187,7 @@ public class DefaultLifecycleRegistry implements LifecycleRegistry { return all.keySet().stream() .filter(id -> !Lifecycle.CLEAN.equals(id) && !Lifecycle.DEFAULT.equals(id) - && !Lifecycle.SITE.equals(id) - && !Lifecycle.WRAPPER.equals(id)) + && !Lifecycle.SITE.equals(id)) .map(id -> wrap(all.get(id))) .collect(Collectors.toList()); } catch (ComponentLookupException e) { @@ -305,15 +304,6 @@ public class DefaultLifecycleRegistry implements LifecycleRegistry { } } - @Singleton - @Named(Lifecycle.WRAPPER) - @SuppressWarnings("unused") - static class WrapperLifecycleProvider extends BaseLifecycleProvider { - WrapperLifecycleProvider() { - super(Lifecycle.WRAPPER); - } - } - static class CleanLifecycle implements Lifecycle { private static final String MAVEN_CLEAN_PLUGIN_VERSION = "3.2.0"; @@ -462,29 +452,4 @@ public class DefaultLifecycleRegistry implements LifecycleRegistry { return List.of(alias("pre-site", BEFORE + PHASE_SITE), alias("post-site", AFTER + PHASE_SITE)); } } - - static class WrapperLifecycle implements Lifecycle { - - private static final String MAVEN_WRAPPER_PLUGIN_VERSION = "3.2.0"; - private static final String PHASE_WRAPPER = "wrapper"; - - @Override - public String id() { - return WRAPPER; - } - - @Override - public Collection phases() { - return List.of(phase( - PHASE_WRAPPER, - plugin( - MAVEN_PLUGINS + "maven-wrapper-plugin:" + MAVEN_WRAPPER_PLUGIN_VERSION + ":wrapper", - PHASE_WRAPPER))); - } - - @Override - public Collection aliases() { - return List.of(); - } - } } diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java index 460cf5b9e4..e3b2817a60 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java @@ -44,7 +44,7 @@ import org.slf4j.LoggerFactory; @Named @Singleton public class DefaultLifecycles { - public static final String[] STANDARD_LIFECYCLES = {"clean", "default", "site", "wrapper"}; + public static final String[] STANDARD_LIFECYCLES = {"clean", "default", "site"}; private final Logger logger = LoggerFactory.getLogger(getClass()); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java index 38be02adae..0856e5ce6e 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java @@ -51,8 +51,8 @@ class DefaultLifecyclesTest { @Test void testDefaultLifecycles() { final List lifecycles = defaultLifeCycles.getLifeCycles(); - assertThat(lifecycles, hasSize(4)); - assertThat(DefaultLifecycles.STANDARD_LIFECYCLES, arrayWithSize(4)); + assertThat(lifecycles, hasSize(3)); + assertThat(DefaultLifecycles.STANDARD_LIFECYCLES, arrayWithSize(3)); } @Test @@ -76,13 +76,6 @@ class DefaultLifecyclesTest { assertThat(lifecycle.getPhases(), hasSize(6)); } - @Test - void testWrapperLifecycle() { - final Lifecycle lifecycle = getLifeCycleById("wrapper"); - assertThat(lifecycle.getId(), is("wrapper")); - assertThat(lifecycle.getPhases(), hasSize(3)); - } - @Test void testCustomLifecycle() throws ComponentLookupException { List myLifecycles = new ArrayList<>(); @@ -103,8 +96,7 @@ class DefaultLifecyclesTest { assertThat(dl.getLifeCycles().get(0).getId(), is("clean")); assertThat(dl.getLifeCycles().get(1).getId(), is("default")); assertThat(dl.getLifeCycles().get(2).getId(), is("site")); - assertThat(dl.getLifeCycles().get(3).getId(), is("wrapper")); - assertThat(dl.getLifeCycles().get(4).getId(), is("etl")); + assertThat(dl.getLifeCycles().get(3).getId(), is("etl")); } private Lifecycle getLifeCycleById(String id) { diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java index 6673e0567b..46f3553c9e 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java @@ -302,7 +302,7 @@ class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase { void testLifecyclePluginsRetrievalForDefaultLifecycle() throws Exception { List plugins = new ArrayList<>(lifecycleExecutor.getPluginsBoundByDefaultToAllLifecycles("jar")); - assertThat(plugins.toString(), plugins, hasSize(9)); + assertThat(plugins.toString(), plugins, hasSize(8)); } @Test diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java index d7e384211d..ff214b796a 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java @@ -46,7 +46,6 @@ import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCal import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.SITE_DEPLOY; import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.TEST; import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.VALIDATE; -import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.WRAPPER; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -73,10 +72,8 @@ public class DefaultLifecyclesStub { List stubSiteCycle = Arrays.asList(PRE_SITE.getPhase(), SITE.getPhase(), POST_SITE.getPhase(), SITE_DEPLOY.getPhase()); - List stubWrapperCycle = Arrays.asList(WRAPPER.getPhase()); - - Iterator> lcs = Arrays.asList(stubDefaultCycle, stubCleanCycle, stubSiteCycle, stubWrapperCycle) - .iterator(); + Iterator> lcs = + Arrays.asList(stubDefaultCycle, stubCleanCycle, stubSiteCycle).iterator(); Map lifeCycles = new HashMap<>(); for (String s : DefaultLifecycles.STANDARD_LIFECYCLES) { diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java index cc1f88bfc3..cd31de5099 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java @@ -93,10 +93,6 @@ public class LifecycleExecutionPlanCalculatorStub implements LifecycleExecutionP public static final MojoDescriptor SITE_DEPLOY = createMojoDescriptor("site-deploy"); - // wrapper - - public static final MojoDescriptor WRAPPER = createMojoDescriptor("wrapper"); - /** * @deprecated instead use {@link #getNumberOfExecutions(ProjectBuildList)} */