From 664d5642cd7d7f32ea197b3ef3e3d6f97a81d322 Mon Sep 17 00:00:00 2001 From: jvanzyl Date: Mon, 5 May 2003 15:07:18 +0000 Subject: [PATCH] Initial revision git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113407 13f79535-47bb-0310-9956-ffa450edef68 --- runner/.cvsignore | 3 + runner/plugin.jelly | 251 ++++++++++++++++++ runner/plugin.properties | 6 + runner/project.properties | 5 + runner/project.xml | 102 +++++++ .../plugin-resources/templates/classworlds.vm | 4 + .../plugin-resources/templates/plexus-bat.vm | 164 ++++++++++++ .../src/plugin-resources/templates/plexus.vm | 127 +++++++++ runner/xdocs/.cvsignore | 1 + runner/xdocs/changes.xml | 16 ++ runner/xdocs/goals.xml | 23 ++ runner/xdocs/index.xml | 15 ++ runner/xdocs/navigation.xml | 16 ++ runner/xdocs/properties.xml | 25 ++ 14 files changed, 758 insertions(+) create mode 100644 runner/.cvsignore create mode 100644 runner/plugin.jelly create mode 100644 runner/plugin.properties create mode 100644 runner/project.properties create mode 100644 runner/project.xml create mode 100644 runner/src/plugin-resources/templates/classworlds.vm create mode 100644 runner/src/plugin-resources/templates/plexus-bat.vm create mode 100644 runner/src/plugin-resources/templates/plexus.vm create mode 100644 runner/xdocs/.cvsignore create mode 100644 runner/xdocs/changes.xml create mode 100644 runner/xdocs/goals.xml create mode 100644 runner/xdocs/index.xml create mode 100644 runner/xdocs/navigation.xml create mode 100644 runner/xdocs/properties.xml diff --git a/runner/.cvsignore b/runner/.cvsignore new file mode 100644 index 00000000..e5e33942 --- /dev/null +++ b/runner/.cvsignore @@ -0,0 +1,3 @@ +target +velocity.log +maven.log diff --git a/runner/plugin.jelly b/runner/plugin.jelly new file mode 100644 index 00000000..635ad878 --- /dev/null +++ b/runner/plugin.jelly @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Retrieving any missing Plexus dependencies ... + + ${plexusPom.verifyDependencies()} + + + + + + + + + + + + @plexusPom = ${plexusPom} + @templatePath = ${templatePath} + @classWorldsConfiguration = ${classWorldsConfiguration} + @classWorldsConfigurationTemplate = ${classWorldsConfigurationTemplate} + + + + + + + + + + + + + @templatePath = ${templatePath} + @unixScript = ${unixScript} + @windowsScript = ${windowsScript} + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/runner/plugin.properties b/runner/plugin.properties new file mode 100644 index 00000000..12eccf72 --- /dev/null +++ b/runner/plugin.properties @@ -0,0 +1,6 @@ +# ------------------------------------------------------------------- +# Default Maven properties for the Plexus plugin. +# ------------------------------------------------------------------- +# These are the properties that we believe are immutable so we +# keep them apart from the project specific properties. +# ------------------------------------------------------------------- diff --git a/runner/project.properties b/runner/project.properties new file mode 100644 index 00000000..8e59598a --- /dev/null +++ b/runner/project.properties @@ -0,0 +1,5 @@ +# ------------------------------------------------------------------- +# P R O J E C T P R O P E R T I E S +# ------------------------------------------------------------------- +maven.license.licenseFile=${basedir}/../../../LICENSE.txt + diff --git a/runner/project.xml b/runner/project.xml new file mode 100644 index 00000000..822c5604 --- /dev/null +++ b/runner/project.xml @@ -0,0 +1,102 @@ + + + + ${basedir}/../project.xml + 3 + maven-runner-plugin + Maven Plexus Plug-in + 0.2 + Various goals for making development with Plexus easy. + Plexus Tools + http://maven.apache.org/reference/plugins/plexus/ + /www/maven.apache.org/reference/plugins/plexus/ + + scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven/src/plugins-build/plexus/ + http://cvs.apache.org/viewcvs/maven/src/plugins-build/plexus/ + + + + + commons-jelly + commons-jelly-tags-velocity + 20030303.205659 + + root.maven + + + + velocity + 1.3 + + + + + commons-collections + 2.0 + + + commons-digester + 1.4.1 + + + commons-beanutils + 1.6.1 + + + commons-lang + 1.0-b1.1 + + + commons-logging + 1.0.2 + + + commons-betwixt + 20030211.133854 + + + dom4j + 1.4-dev-8 + http://www.dom4j.org/ + + + commons-jelly + 20030211.141339 + http://jakarta.apache.org/commons/jelly/ + + + commons-jexl + 1.0-beta-1 + http://jakarta.apache.org/commons/jexl/ + + + ant + 1.5.1 + + + + + xerces + 2.0.2 + + + xml-apis + 1.0.b2 + + + + + plexus + 0.2 + pom + + + plexus + 0.2 + + + diff --git a/runner/src/plugin-resources/templates/classworlds.vm b/runner/src/plugin-resources/templates/classworlds.vm new file mode 100644 index 00000000..644bbe24 --- /dev/null +++ b/runner/src/plugin-resources/templates/classworlds.vm @@ -0,0 +1,4 @@ +main is org.apache.plexus.PlexusContainerHost from core + +[core] +load ${lib}/*.jar diff --git a/runner/src/plugin-resources/templates/plexus-bat.vm b/runner/src/plugin-resources/templates/plexus-bat.vm new file mode 100644 index 00000000..ffe0b1ff --- /dev/null +++ b/runner/src/plugin-resources/templates/plexus-bat.vm @@ -0,0 +1,164 @@ +@REM ---------------------------------------------------------------------------- +@REM Plexus Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM PLEXUS_HOME - location of Plexus installed home dir +@REM +@REM Optional ENV vars +@REM PLEXUS_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM PLEXUS_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM PLEXUS_OPTS - parameters passed to the Java VM when running Plexus +@REM e.g. to debug Plexus itself, use +@REM set PLEXUS_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 ---------------------------------------------------------------------------- + + +CLASSWORLDS_VERSION=1.0-beta-5 +MAIN_CLASS=com.werken.classworlds.Launcher +PLEXUS_OPTS="-Xmx128m" + +@REM Begin all REM lines with '@' in case PLEXUS_BATCH_ECHO is 'on' +@echo off +@REM enable echoing my setting PLEXUS_BATCH_ECHO to 'on' +@if "%PLEXUS_BATCH_ECHO%" == "on" echo %PLEXUS_BATCH_ECHO% + +@REM Execute a user defined script before this one +if exist "%HOME%\plexusrc_pre.bat" call "%HOME%\plexusrc_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 PLEXUS_COMMAND_COM="cmd.exe" +if exist "%SystemRoot%\system32\cmd.exe" set PLEXUS_COMMAND_COM="%SystemRoot%\system32\cmd.exe" +if exist "%SystemRoot%\command.com" set PLEXUS_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 PLEXUS_FIND_EXE="find.exe" +if exist "%SystemRoot%\system32\find.exe" set PLEXUS_FIND_EXE="%SystemRoot%\system32\find.exe" +if exist "%SystemRoot%\command\find.exe" set PLEXUS_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 +%PLEXUS_COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %PLEXUS_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 "%PLEXUS_HOME%"=="" goto valMHome + +echo. +echo ERROR: PLEXUS_HOME not found in your environment. +echo Please set the PLEXUS_HOME variable in your environment to match the +echo location of the Plexus installation +echo. +goto end + +:valMHome +%PLEXUS_COMMAND_COM% /C DIR "%PLEXUS_HOME%" 2>&1 | %PLEXUS_FIND_EXE% /I /C "%PLEXUS_HOME%" >nul +if not errorlevel 1 goto init + +echo. +echo ERROR: PLEXUS_HOME is set to an invalid directory. +echo PLEXUS_HOME = %PLEXUS_HOME% +echo Please set the PLEXUS_HOME variable in your environment to match the +echo location of the Plexus 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 PLEXUS_CMD_LINE_ARGS=%* +goto endInit + +@REM The 4NT Shell from jp software +:4NTArgs +set PLEXUS_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 PLEXUS_CMD_LINE_ARGS= +:Win9xApp +if %1a==a goto endInit +set PLEXUS_CMD_LINE_ARGS=%PLEXUS_CMD_LINE_ARGS% %1 +shift +goto Win9xApp + +@REM Reaching here means variables are defined and arguments have been captured +:endInit +SET PLEXUS_DEFAULT_OPTS="-Xmx160m" +SET PLEXUS_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +SET PLEXUS_ENDORSED="-Djava.endorsed.dirs=%JAVA_HOME%\lib\endorsed;%PLEXUS_HOME%\lib\endorsed" + +@REM Start PLEXUS +%PLEXUS_JAVA_EXE% -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl "-Dplexus.home=%PLEXUS_HOME%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%PLEXUS_HOME%\bin\forehead.conf" %PLEXUS_ENDORSED% %PLEXUS_DEFAULT_OPTS% %PLEXUS_OPTS% -classpath %PLEXUS_CLASSPATH% %PLEXUS_MAIN_CLASS% %PLEXUS_CMD_LINE_ARGS% + + + $PLEXUS_OPTS \ + -classpath ${PLEXUS_HOME}/lib/classworlds-${CLASSWORLDS_VERSION}.jar \ + -Dclassworlds.conf=${PLEXUS_HOME}/conf/classworlds.conf \ + -Dlib=${PLEXUS_HOME}/lib \ + -Dtools.jar=$TOOLS_JAR \ + -Dplexus.home=${PLEXUS_HOME} \ + $MAIN_CLASS ${CONF} + + +: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 PLEXUS_COMMAND_COM= +set PLEXUS_FIND_EXE= +set PLEXUS_DEFAULT_OPTS= +set PLEXUS_JAVA_EXE= +set PLEXUS_CLASSPATH= +set PLEXUS_MAIN_CLASS= +set PLEXUS_CMD_LINE_ARGS= +SET PLEXUS_ENDORSED= +goto postExec + +:endNT +@endlocal + +:postExec +if exist "%HOME%\plexusrc_post.bat" call "%HOME%\plexusrc_post.bat" +@REM pause the batch file if PLEXUS_BATCH_PAUSE is set to 'on' +if "%PLEXUS_BATCH_PAUSE%" == "on" pause diff --git a/runner/src/plugin-resources/templates/plexus.vm b/runner/src/plugin-resources/templates/plexus.vm new file mode 100644 index 00000000..9ee85732 --- /dev/null +++ b/runner/src/plugin-resources/templates/plexus.vm @@ -0,0 +1,127 @@ +#! /bin/sh + +CLASSWORLDS_VERSION=1.0-beta-5 +MAIN_CLASS=com.werken.classworlds.Launcher +PLEXUS_OPTS="-Xmx128m" + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false +darwin=false; +case "`uname`" in +CYGWIN*) cygwin=true;; +Darwin*) darwin=true ;; +esac + +# resolve links - $0 may be a softlink +THIS_PROG="$0" + +while [ -h "$THIS_PROG" ]; do + ls=`ls -ld "$THIS_PROG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '.*/.*' > /dev/null; then + THIS_PROG="$link" + else + THIS_PROG=`dirname "$THIS_PROG"`/"$link" + fi +done + +# Get standard environment variables +PRGDIR=`dirname "$THIS_PROG"` +PLEXUS_HOME=`cd "$PRGDIR/.." ; pwd` +PLEXUS_CONF=`cd "$PLEXUS_HOME/conf" ; pwd` +unset THIS_PROG + +#if ( $jre ) + +JAVA_HOME=${PLEXUS_HOME}/jre + +#end + +# Checking for JAVA_HOME is required on *nix due +# to some distributions stupidly including kaffe in /usr/bin +if [ "$JAVA_HOME" = "" ] ; then + echo "ERROR: JAVA_HOME not found in your environment." + echo + echo "Please, set the JAVA_HOME variable in your environment to match the" + echo "location of the Java Virtual Machine you want to use." + exit 1 +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$PLEXUS_HOME" ] && + PLEXUS_HOME=`cygpath --unix "$PLEXUS_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +if [ -z "$PLEXUS_TMPDIR" ] ; then + PLEXUS_TMPDIR="$PLEXUS_HOME"/temp + mkdir -p "$PLEXUS_TMPDIR" +fi + +if [ -z "$JAVACMD" ] ; then + 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 + fi + else + JAVACMD=java + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." + echo " We cannot execute $JAVACMD" + exit +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." + echo " If build fails because sun.* classes could not be found" + echo " you will need to set the JAVA_HOME environment variable" + echo " to the installation directory of java." +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + PLEXUS_HOME=`cygpath --path --windows "$PLEXUS_HOME"` + PLEXUS_CONF=`cygpath --path --windows "$PLEXUS_CONF"` + PLEXUS_TMPDIR=`cygpath --path --windows "$PLEXUS_TMPDIR"` + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` +fi + +# For Darwin, use classes.jar for TOOLS_JAR +TOOLS_JAR="${JAVA_HOME}/lib/tools.jar" +if $darwin; then + TOOLS_JAR="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes/classes.jar" +fi + +# ----- Execute The Requested Command ----------------------------------------- + +echo "Using PLEXUS_HOME: $PLEXUS_HOME" +echo "Using PLEXUS_CONF: $PLEXUS_CONF" +echo "Using PLEXUS_TMPDIR: $PLEXUS_TMPDIR" +echo "Using JAVA_HOME: $JAVA_HOME" + +if [ "$1" = "" ] +then + CONF=${PLEXUS_CONF}/plexus.conf +else + CONF=$1 +fi + +$JAVACMD \ + $PLEXUS_OPTS \ + -classpath ${PLEXUS_HOME}/lib/classworlds-${CLASSWORLDS_VERSION}.jar \ + -Dclassworlds.conf=${PLEXUS_HOME}/conf/classworlds.conf \ + -Dlib=${PLEXUS_HOME}/lib \ + -Djava.io.tmpdir=${PLEXUS_TMPDIR} \ + -Dtools.jar=$TOOLS_JAR \ + -Dplexus.home=${PLEXUS_HOME} \ + $MAIN_CLASS ${CONF} diff --git a/runner/xdocs/.cvsignore b/runner/xdocs/.cvsignore new file mode 100644 index 00000000..cb6131bb --- /dev/null +++ b/runner/xdocs/.cvsignore @@ -0,0 +1 @@ +stylesheets diff --git a/runner/xdocs/changes.xml b/runner/xdocs/changes.xml new file mode 100644 index 00000000..8c68b109 --- /dev/null +++ b/runner/xdocs/changes.xml @@ -0,0 +1,16 @@ + + + + Changes + Jason van Zyl + + + + + + Original release for Maven 1.0-beta8 + + + + + diff --git a/runner/xdocs/goals.xml b/runner/xdocs/goals.xml new file mode 100644 index 00000000..4a3fc5de --- /dev/null +++ b/runner/xdocs/goals.xml @@ -0,0 +1,23 @@ + + + + + Maven Plexus Plug-in Goals + Jason van Zyl + + + +
+ + + + + + +
GoalDescription
plexus:runtime + For a given project generate a plexus runtime using the required + components. +
+
+ +
diff --git a/runner/xdocs/index.xml b/runner/xdocs/index.xml new file mode 100644 index 00000000..955c2ad1 --- /dev/null +++ b/runner/xdocs/index.xml @@ -0,0 +1,15 @@ + + + + + Maven Ant Plug-in + Jason van Zyl + + + +
+

+

+
+ +
diff --git a/runner/xdocs/navigation.xml b/runner/xdocs/navigation.xml new file mode 100644 index 00000000..febe22bc --- /dev/null +++ b/runner/xdocs/navigation.xml @@ -0,0 +1,16 @@ + + + + Maven Plexus Plugin + + + + + + + + + + + + diff --git a/runner/xdocs/properties.xml b/runner/xdocs/properties.xml new file mode 100644 index 00000000..cfa110cc --- /dev/null +++ b/runner/xdocs/properties.xml @@ -0,0 +1,25 @@ + + + + + Maven Ant Plugin Properties + dIon Gillard + + + +
+ + + + + + + + + + + +
Property nameOptional?Description
+
+ +