Return-Path: Delivered-To: apmail-maven-dev-archive@maven.apache.org Received: (qmail 11483 invoked by uid 500); 4 Jun 2003 08:47:38 -0000 Mailing-List: contact dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Maven Developers List" Reply-To: "Maven Developers List" Delivered-To: mailing list dev@maven.apache.org Received: (qmail 11470 invoked by uid 500); 4 Jun 2003 08:47:37 -0000 Received: (qmail 11467 invoked from network); 4 Jun 2003 08:47:37 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 4 Jun 2003 08:47:37 -0000 Received: (qmail 66873 invoked by uid 1262); 4 Jun 2003 08:47:36 -0000 Date: 4 Jun 2003 08:47:36 -0000 Message-ID: <20030604084736.66872.qmail@icarus.apache.org> From: vmassol@apache.org To: maven-cvs@apache.org Subject: cvs commit: maven/src/bin maven.bat X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N vmassol 2003/06/04 01:47:36 Modified: src/bin maven.bat Log: Applied Matt Johnson's patch to let users use the JVM -Xmx settings in MAVEN_OPTS environment variable. Revision Changes Path 1.35 +160 -161 maven/src/bin/maven.bat Index: maven.bat =================================================================== RCS file: /home/cvs/maven/src/bin/maven.bat,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- maven.bat 4 May 2003 23:48:20 -0000 1.34 +++ maven.bat 4 Jun 2003 08:47:36 -0000 1.35 @@ -1,161 +1,160 @@ -@REM ---------------------------------------------------------------------------- -@REM Maven Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM MAVEN_HOME - location of maven's installed home dir -@REM -@REM Optional ENV vars -@REM MAVEN_HOME_LOCAL - may override default dir Maven writes work files -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM -@REM Utility rquirements: -@REM Windows' find.exe -@REM Windows' cmd.exe (NT) OR command.com ( 98 or ME ) -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM enable echoing my 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 exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" - -@REM set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" @setlocal - -@REM For Windows NT, use cmd.exe to execute the "CD" later -@REM For Win 98ME, use comand.com - if neither is found , default to use -@REM cmd.exe in the path and hope we'll hit a Win version of it -@REM FYI: Using command.com on Win NT causes "Parameter format not correct" error -set MAVEN_COMMAND_COM="cmd.exe" -if exist "%SystemRoot%\system32\cmd.exe" set MAVEN_COMMAND_COM="%SystemRoot%\system32\cmd.exe" -if exist "%SystemRoot%\command.com" set MAVEN_COMMAND_COM="%SystemRoot%\command.com" - -@REM Use explicit find.exe to prevent cygwin and others find.exe from being -@REM used instead - we use this to test dir existance in a cross-win-platform way -set MAVEN_FIND_EXE="find.exe" -if exist "%SystemRoot%\system32\find.exe" set MAVEN_FIND_EXE="%SystemRoot%\system32\find.exe" -if exist "%SystemRoot%\command\find.exe" set MAVEN_FIND_EXE="%SystemRoot%\command\find.exe" - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo ERROR: JAVA_HOME not found in your environment. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation -echo. -goto end - -:OkJHome -%MAVEN_COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %MAVEN_FIND_EXE% /I /C "%JAVA_HOME%" >nul -if not errorlevel 1 goto chkMHome - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory. -echo JAVA_HOME = %JAVA_HOME% -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation -echo. -goto end - -:chkMHome -if not "%MAVEN_HOME%"=="" goto valMHome - -echo. -echo ERROR: MAVEN_HOME not found in your environment. -echo Please set the MAVEN_HOME variable in your environment to match the -echo location of the Maven installation -echo. -goto end - -:valMHome -%MAVEN_COMMAND_COM% /C DIR "%MAVEN_HOME%" 2>&1 | %MAVEN_FIND_EXE% /I /C "%MAVEN_HOME%" >nul -if not errorlevel 1 goto init - -echo. -echo ERROR: MAVEN_HOME is set to an invalid directory. -echo MAVEN_HOME = %MAVEN_HOME% -echo Please set the MAVEN_HOME variable in your environment to match the -echo location of the Maven installation -echo. -goto end -@REM ==== END VALIDATION ==== - -:init -@REM Decide how to startup depending on the version of windows - -@REM -- Win98ME -if NOT "%OS%"=="Windows_NT" goto Win9xArg - -@REM -- 4NT shell -if "%eval[2+2]" == "4" goto 4NTArgs - -@REM -- Regular WinNT shell -set MAVEN_CMD_LINE_ARGS=%* -goto endInit - -@REM The 4NT Shell from jp software -:4NTArgs -set MAVEN_CMD_LINE_ARGS=%$ -goto endInit - -:Win9xArg -@REM Slurp the command line arguments. This loop allows for an unlimited number -@REM of agruments (up to the command line limit, anyway). -set MAVEN_CMD_LINE_ARGS= -:Win9xApp -if %1a==a goto endInit -set MAVEN_CMD_LINE_ARGS=%MAVEN_CMD_LINE_ARGS% %1 -shift -goto Win9xApp - -@REM Reaching here means variables are defined and arguments have been captured -:endInit -SET MAVEN_DEFAULT_OPTS="-Xmx160m" -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -SET MAVEN_CLASSPATH="%MAVEN_HOME%\lib\forehead-1.0-beta-4.jar" -SET MAVEN_MAIN_CLASS="com.werken.forehead.Forehead" -SET MAVEN_ENDORSED="-Djava.endorsed.dirs=%JAVA_HOME%\lib\endorsed;%MAVEN_HOME%\lib\endorsed" -if not "%MAVEN_HOME_LOCAL%" == "" goto StartMHL - -@REM Start MAVEN without MAVEN_HOME_LOCAL override -%MAVEN_JAVA_EXE% -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl "-Dmaven.home=%MAVEN_HOME%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%MAVEN_HOME%\bin\forehead.conf" %MAVEN_ENDORSED% %MAVEN_DEFAULT_OPTS% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS% -@REM %MAVEN_JAVA_EXE% -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl "-Dmaven.home=%MAVEN_HOME%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%MAVEN_HOME%\bin\forehead.conf" %MAVEN_ENDORSED% %MAVEN_DEFAULT_OPTS% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS% -goto :end - -@REM Start MAVEN with MAVEN_HOME_LOCAL override -:StartMHL -%MAVEN_JAVA_EXE% -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl "-Dmaven.home=%MAVEN_HOME%" "-Dmaven.home.local=%MAVEN_HOME_LOCAL%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%MAVEN_HOME%\bin\forehead.conf" %MAVEN_ENDORSED% %MAVEN_DEFAULT_OPTS% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS% -@REM %MAVEN_JAVA_EXE% -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl "-Dmaven.home=%MAVEN_HOME%" "-Dmaven.home.local=%MAVEN_HOME_LOCAL%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%MAVEN_HOME%\bin\forehead.conf" %MAVEN_ENDORSED% %MAVEN_DEFAULT_OPTS% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS% - -:end -@REM set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" goto endNT - -@REM For old DOS remove the set variables from ENV - we assume they were not set -@REM before we started - at least we don't leave any baggage around -set MAVEN_COMMAND_COM= -set MAVEN_FIND_EXE= -set MAVEN_DEFAULT_OPTS= -set MAVEN_JAVA_EXE= -set MAVEN_CLASSPATH= -set MAVEN_MAIN_CLASS= -set MAVEN_CMD_LINE_ARGS= -SET MAVEN_ENDORSED= -goto postExec - -:endNT -@endlocal - -:postExec -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -@REM pause the batch file if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM MAVEN_HOME - location of maven's installed home dir +@REM +@REM Optional ENV vars +@REM MAVEN_HOME_LOCAL - may override default dir Maven writes work files +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM +@REM Utility rquirements: +@REM Windows' find.exe +@REM Windows' cmd.exe (NT) OR command.com ( 98 or ME ) +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM enable echoing my 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 exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" + +@REM set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" @setlocal + +@REM For Windows NT, use cmd.exe to execute the "CD" later +@REM For Win 98ME, use comand.com - if neither is found , default to use +@REM cmd.exe in the path and hope we'll hit a Win version of it +@REM FYI: Using command.com on Win NT causes "Parameter format not correct" error +set MAVEN_COMMAND_COM="cmd.exe" +if exist "%SystemRoot%\system32\cmd.exe" set MAVEN_COMMAND_COM="%SystemRoot%\system32\cmd.exe" +if exist "%SystemRoot%\command.com" set MAVEN_COMMAND_COM="%SystemRoot%\command.com" + +@REM Use explicit find.exe to prevent cygwin and others find.exe from being +@REM used instead - we use this to test dir existance in a cross-win-platform way +set MAVEN_FIND_EXE="find.exe" +if exist "%SystemRoot%\system32\find.exe" set MAVEN_FIND_EXE="%SystemRoot%\system32\find.exe" +if exist "%SystemRoot%\command\find.exe" set MAVEN_FIND_EXE="%SystemRoot%\command\find.exe" + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo ERROR: JAVA_HOME not found in your environment. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation +echo. +goto end + +:OkJHome +%MAVEN_COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %MAVEN_FIND_EXE% /I /C "%JAVA_HOME%" >nul +if not errorlevel 1 goto chkMHome + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory. +echo JAVA_HOME = %JAVA_HOME% +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation +echo. +goto end + +:chkMHome +if not "%MAVEN_HOME%"=="" goto valMHome + +echo. +echo ERROR: MAVEN_HOME not found in your environment. +echo Please set the MAVEN_HOME variable in your environment to match the +echo location of the Maven installation +echo. +goto end + +:valMHome +%MAVEN_COMMAND_COM% /C DIR "%MAVEN_HOME%" 2>&1 | %MAVEN_FIND_EXE% /I /C "%MAVEN_HOME%" >nul +if not errorlevel 1 goto init + +echo. +echo ERROR: MAVEN_HOME is set to an invalid directory. +echo MAVEN_HOME = %MAVEN_HOME% +echo Please set the MAVEN_HOME variable in your environment to match the +echo location of the Maven installation +echo. +goto end +@REM ==== END VALIDATION ==== + +:init +@REM Decide how to startup depending on the version of windows + +@REM -- Win98ME +if NOT "%OS%"=="Windows_NT" goto Win9xArg + +@REM -- 4NT shell +if "%eval[2+2]" == "4" goto 4NTArgs + +@REM -- Regular WinNT shell +set MAVEN_CMD_LINE_ARGS=%* +goto endInit + +@REM The 4NT Shell from jp software +:4NTArgs +set MAVEN_CMD_LINE_ARGS=%$ +goto endInit + +:Win9xArg +@REM Slurp the command line arguments. This loop allows for an unlimited number +@REM of agruments (up to the command line limit, anyway). +set MAVEN_CMD_LINE_ARGS= +:Win9xApp +if %1a==a goto endInit +set MAVEN_CMD_LINE_ARGS=%MAVEN_CMD_LINE_ARGS% %1 +shift +goto Win9xApp + +@REM Reaching here means variables are defined and arguments have been captured +:endInit +if "%MAVEN_OPTS%"=="" SET MAVEN_OPTS=-Xmx160m +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +SET MAVEN_CLASSPATH="%MAVEN_HOME%\lib\forehead-1.0-beta-4.jar" +SET MAVEN_MAIN_CLASS="com.werken.forehead.Forehead" +SET MAVEN_ENDORSED="-Djava.endorsed.dirs=%JAVA_HOME%\lib\endorsed;%MAVEN_HOME%\lib\endorsed" +if not "%MAVEN_HOME_LOCAL%" == "" goto StartMHL + +@REM Start MAVEN without MAVEN_HOME_LOCAL override +%MAVEN_JAVA_EXE% -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl "-Dmaven.home=%MAVEN_HOME%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%MAVEN_HOME%\bin\forehead.conf" %MAVEN_ENDORSED% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS% +@REM %MAVEN_JAVA_EXE% -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl "-Dmaven.home=%MAVEN_HOME%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%MAVEN_HOME%\bin\forehead.conf" %MAVEN_ENDORSED% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS% +goto :end + +@REM Start MAVEN with MAVEN_HOME_LOCAL override +:StartMHL +%MAVEN_JAVA_EXE% -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl "-Dmaven.home=%MAVEN_HOME%" "-Dmaven.home.local=%MAVEN_HOME_LOCAL%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%MAVEN_HOME%\bin\forehead.conf" %MAVEN_ENDORSED% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS% +@REM %MAVEN_JAVA_EXE% -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl "-Dmaven.home=%MAVEN_HOME%" "-Dmaven.home.local=%MAVEN_HOME_LOCAL%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%MAVEN_HOME%\bin\forehead.conf" %MAVEN_ENDORSED% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS% + +:end +@REM set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" goto endNT + +@REM For old DOS remove the set variables from ENV - we assume they were not set +@REM before we started - at least we don't leave any baggage around +set MAVEN_COMMAND_COM= +set MAVEN_FIND_EXE= +set MAVEN_JAVA_EXE= +set MAVEN_CLASSPATH= +set MAVEN_MAIN_CLASS= +set MAVEN_CMD_LINE_ARGS= +SET MAVEN_ENDORSED= +goto postExec + +:endNT +@endlocal + +:postExec +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +@REM pause the batch file if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For additional commands, e-mail: dev-help@maven.apache.org