You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jv...@apache.org on 2002/12/12 08:33:28 UTC
cvs commit: jakarta-turbine-maven/src/plugins-build/plexus/templates classworlds.vm plexus.vm
jvanzyl 2002/12/11 23:33:28
Modified: src/plugins-build/plexus maven.xml plugin.jelly project.xml
src/plugins-build/plexus/templates classworlds.vm plexus.vm
Added: src/plugins-build/plexus plexus.pom
src/plugins-build/plexus/src/conf plexus.conf
Log:
o Not for public consumption but another step toward a maven plugin
for plexus. It will still only work currently if you have the resources
on your machine but getting there. I just need to make an easy way
to pull down the dependencies of another project. An interesting little
exercise in inter-project plugins. Making a plugin to create a runtime
that requires the dependencies of other projects.
Revision Changes Path
1.2 +0 -1 jakarta-turbine-maven/src/plugins-build/plexus/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/plexus/maven.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- maven.xml 18 Nov 2002 22:28:02 -0000 1.1
+++ maven.xml 12 Dec 2002 07:33:27 -0000 1.2
@@ -17,7 +17,6 @@
<copy todir="${assemblyDir}">
<fileset dir=".">
<exclude name="target/**"/>
- <exclude name="src/**"/>
<exclude name="maven.xml"/>
<exclude name="maven.log"/>
</fileset>
1.6 +37 -21 jakarta-turbine-maven/src/plugins-build/plexus/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/plexus/plugin.jelly,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- plugin.jelly 12 Dec 2002 00:40:24 -0000 1.5
+++ plugin.jelly 12 Dec 2002 07:33:27 -0000 1.6
@@ -24,22 +24,33 @@
<mkdir dir="${maven.plexus.lib}"/>
<mkdir dir="${maven.plexus.log}"/>
<mkdir dir="${maven.plexus.work}"/>
-
- <copy todir="${maven.plexus.appLib}">
- <fileset dir="${maven.plexus.componentBuilds}/app-lib"/>
- </copy>
-
- <attainGoal name="launcherConfiguration"/>
- <attainGoal name="script"/>
-
- <deploy:copy-deps todir="${maven.plexus.lib}" excludes="junit"/>
-
+
<copy todir="${maven.plexus.conf}">
- <fileset dir="${maven.src.dir}/conf"/>
+ <fileset dir="${plugin.dir}/src/conf"/>
</copy>
<mkdir dir="${maven.plexus.components}"/>
+ <!-- Copy the plexus dependencies into the runtime lib/. -->
+ <deploy:copy-deps
+ projectDescriptor="${plugin.dir}/plexus.pom"
+ todir="${maven.plexus.lib}"
+ excludes="junit"
+ />
+
+ <!-- Copy plexus itself to the runtime lib/. This needs to be simplified. -->
+ <maven:pom projectDescriptor="${plugin.dir}/plexus.pom" var="plexusPom"/>
+ <copy
+ todir="${maven.plexus.lib}"
+ file="${maven.repo.local}/${plexusPom.id}/jars/${plexusPom.id}-${plexusPom.currentVersion}.jar"
+ />
+
+ <!-- Create the classworlds configuration. -->
+ <attainGoal name="classworlds-configuration"/>
+
+ <!-- Create the startup shell script. -->
+ <attainGoal name="startup-shell-script"/>
+
</goal>
<!-- ===================================================================== -->
@@ -61,14 +72,19 @@
<!-- G E N E R A T E L A U N C H E R C O N F I G U R A T I O N -->
<!-- ===================================================================== -->
- <goal name="launcherConfiguration" prereqs="init-texen-tag"
+ <goal
+ name="classworlds-configuration"
+ prereqs="init-texen-tag"
description="Generate launcher configuration">
- <texen:generate
+
+ <maven:pom projectDescriptor="${plugin.dir}/plexus.pom" var="plexusPom"/>
+
+ <texen:texen
controlTemplate="${maven.plexus.launcherConfigurationTemplate}"
outputDirectory="${maven.plexus.conf}"
templatePath="${maven.plexus.templatePath}"
outputFile="${maven.plexus.launcherConfiguration}"
- mavenProject="${pom}"
+ mavenProject="${plexusPom}"
/>
</goal>
@@ -76,15 +92,15 @@
<!-- G E N E R A T E S T A R T E R S C R I P T -->
<!-- ===================================================================== -->
- <goal name="script" prereqs="init-texen-tag"
+ <goal
+ name="startup-shell-script"
description="Generate starter script">
- <texen:generate
- controlTemplate="plexus.vm"
- outputDirectory="${maven.plexus.bin}"
- templatePath="${maven.plexus.templatePath}"
- outputFile="plexus.sh"
- mavenProject="${pom}"
+
+ <copy
+ file="${maven.plexus.templatePath}/plexus.vm"
+ tofile="${maven.plexus.bin}/plexus.sh"
/>
+
<chmod file="${maven.plexus.bin}/plexus.sh" perm="+x"/>
</goal>
1.2 +2 -27 jakarta-turbine-maven/src/plugins-build/plexus/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/plexus/project.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- project.xml 18 Nov 2002 22:28:01 -0000 1.1
+++ project.xml 12 Dec 2002 07:33:27 -0000 1.2
@@ -14,39 +14,14 @@
<package>org.apache.maven</package>
<logo>http://jakarta.apache.org/turbine/maven/images/maven.jpg</logo>
- <!-- Gump integration -->
- <gumpRepositoryId>jakarta</gumpRepositoryId>
-
<description>
Various goals for making development with Plexus easy.
</description>
<shortDescription>Plexus Tools</shortDescription>
- <url>http://jakarta.apache.org/turbine/maven/reference/plugins/ant/</url>
- <issueTrackingUrl>http://nagoya.apache.org/scarab/servlet/scarab/</issueTrackingUrl>
- <siteAddress>jakarta.apache.org</siteAddress>
- <siteDirectory>/www/jakarta.apache.org/turbine/maven/reference/plugins/ant/</siteDirectory>
- <distributionDirectory>/www/jakarta.apache.org/builds/jakarta-turbine-maven/</distributionDirectory>
-
- <repository>
- <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-turbine-maven/src/plugins-build/ant/</connection>
- <url>http://cvs.apache.org/viewcvs/jakarta-turbine-maven/src/plugins-build/ant/</url>
- </repository>
-
- <developers>
- <developer>
- <name>Jason van Zyl</name>
- <id>jvanzyl</id>
- <email>jason@zenplex.com</email>
- <organization>Zenplex</organization>
- <roles>
- <role>Architect</role>
- <role>Release Manager</role>
- </roles>
- </developer>
- </developers>
-
+ <repository/>
+ <developers/>
<build/>
</project>
1.1 jakarta-turbine-maven/src/plugins-build/plexus/plexus.pom
Index: plexus.pom
===================================================================
<?xml version="1.0"?>
<project>
<pomVersion>3</pomVersion>
<id>plexus</id>
<name>plexus</name>
<currentVersion>0.1</currentVersion>
<organization>
<name>Apache Software Foundation</name>
<url>http://jakarta.apache.org/</url>
<logo>/images/zen_logo2.gif</logo>
</organization>
<inceptionYear>2001</inceptionYear>
<package>org.apache.plexus</package>
<logo>/images/logo-80p.jpg</logo>
<!-- Gump integration -->
<gumpRepositoryId>jakarta</gumpRepositoryId>
<description>
</description>
<shortDescription></shortDescription>
<url>http://jakarta.apache.org/turbine/maven/</url>
<issueTrackingUrl>http://nagoya.apache.org/scarab/servlet/scarab/</issueTrackingUrl>
<siteAddress>jakarta.apache.org</siteAddress>
<siteDirectory>/www/jakarta.apache.org/turbine/maven/</siteDirectory>
<distributionDirectory>/www/jakarta.apache.org/builds/jakarta-turbine-maven/</distributionDirectory>
<repository>
<connection>scm:cvs:pserver:anon@tambora.zenplex.org:/var2/cvs:plexus</connection>
<url>http://tambora.zenplex.org/cgi-bin/cvsweb.cgi/plexus/</url>
</repository>
<versions/>
<branches/>
<mailingLists>
<mailingList>
<name>Maven User List</name>
<subscribe>turbine-maven-user-subscribe@jakarta.apache.org</subscribe>
<unsubscribe>turbine-maven-user-unsubscribe@jakarta.apache.org</unsubscribe>
<archive>http://www.mail-archive.com/turbine-maven-user@jakarta.apache.org/</archive>
</mailingList>
<mailingList>
<name>Maven Developer List</name>
<subscribe>turbine-maven-dev-subscribe@jakarta.apache.org</subscribe>
<unsubscribe>turbine-maven-dev-unsubscribe@jakarta.apache.org</unsubscribe>
<archive>http://www.mail-archive.com/turbine-maven-dev@jakarta.apache.org/</archive>
</mailingList>
</mailingLists>
<developers>
<developer>
<name>Jason van Zyl</name>
<id>jvanzyl</id>
<email>jason@zenplex.com</email>
<organization>Zenplex</organization>
<roles>
<role>Architect</role>
<role>Release Manager</role>
</roles>
</developer>
</developers>
<dependencies>
<dependency>
<id>ant</id>
<version>1.5</version>
</dependency>
<dependency>
<id>commons-logging</id>
<version>1.0.2</version>
</dependency>
<dependency>
<id>log4j</id>
<version>1.2.6</version>
</dependency>
<dependency>
<id>avalon-framework</id>
<version>4.0</version>
</dependency>
<dependency>
<id>excalibur-component</id>
<version>1.0</version>
</dependency>
<dependency>
<id>excalibur-logger</id>
<version>1.0</version>
</dependency>
<dependency>
<id>servletapi</id>
<version>2.3</version>
</dependency>
<dependency>
<id>xml-apis</id>
<version>1.0.b2</version>
</dependency>
<dependency>
<id>xerces</id>
<version>2.0.2</version>
</dependency>
<dependency>
<id>xalan</id>
<version>2.3.1</version>
</dependency>
<dependency>
<id>classworlds</id>
<version>1.0-beta-1</version>
</dependency>
<!-- Testing -->
<dependency>
<id>junit</id>
<version>3.8</version>
</dependency>
</dependencies>
<build>
<nagEmailAddress>turbine-maven-dev@jakarta.apache.org</nagEmailAddress>
<sourceDirectory>src/java</sourceDirectory>
<unitTestSourceDirectory>src/test</unitTestSourceDirectory>
<!-- Unit test classes -->
<unitTest>
<includes>
<include>**/*Test.java</include>
<include>**/*TestCase.java</include>
</includes>
<excludes>
<exclude>**/PlexusTest.java</exclude>
<exclude>**/*Host*.java</exclude>
</excludes>
<resources>
<resource>
<directory>src/test</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</unitTest>
<resources/>
</build>
</project>
1.1 jakarta-turbine-maven/src/plugins-build/plexus/src/conf/plexus.conf
Index: plexus.conf
===================================================================
<plexus>
<!--
| Services that should be started when the application starts.
-->
<load-on-start>
</load-on-start>
<resources>
</resources>
<factories>
</factories>
<components>
</components>
</plexus>
1.2 +1 -1 jakarta-turbine-maven/src/plugins-build/plexus/templates/classworlds.vm
Index: classworlds.vm
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/plexus/templates/classworlds.vm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- classworlds.vm 18 Nov 2002 22:28:02 -0000 1.1
+++ classworlds.vm 12 Dec 2002 07:33:28 -0000 1.2
@@ -3,7 +3,7 @@
[core]
#foreach ($jar in $project.dependencies)
#if (!$jar.id.startsWith("classworlds") && !$jar.id.startsWith("junit"))
-load ${lib}/$jar.artifact
+load ${lib}/${jar.artifact}jar
#end
#end
load ${lib}/${project.id}-${project.currentVersion}.jar
1.2 +49 -46 jakarta-turbine-maven/src/plugins-build/plexus/templates/plexus.vm
Index: plexus.vm
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/plexus/templates/plexus.vm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- plexus.vm 18 Nov 2002 22:28:02 -0000 1.1
+++ plexus.vm 12 Dec 2002 07:33:28 -0000 1.2
@@ -1,59 +1,45 @@
#! /bin/sh
-# Copyright (c) 2001-2002 The Apache Software Foundation. All rights
-# reserved.
-
CLASSWORLDS_VERSION=1.0-beta-1
-
+MAIN_CLASS=com.werken.classworlds.Launcher
PLEXUS_OPTS="-Xmx128m"
-if [ -f "$HOME/.mavenrc" ] ; then
- . $HOME/.mavenrc
-fi
-
# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
+cygwin=false
darwin=false;
case "`uname`" in
- CYGWIN*) cygwin=true ;;
- Darwin*) darwin=true ;;
+CYGWIN*) cygwin=true;;
+Darwin*) darwin=true ;;
esac
-if [ -z "$PLEXUS_HOME" ] ; then
- # try to find MAVEN
- if [ -d /opt/maven ] ; then
- PLEXUS_HOME=/opt/maven
- fi
-
- if [ -d ${HOME}/maven ] ; then
- PLEXUS_HOME=${HOME}/maven
+# 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
+
+# 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
- ## resolve links - $0 may be a link to maven's home
- PRG=$0
- progname=`basename $0`
- saveddir=`pwd`
-
- # need this for relative symlinks
- cd `dirname $PRG`
-
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '.*/.*' > /dev/null; then
-x PRG="$link"
- else
- PRG="`dirname $PRG`/$link"
- fi
- done
-
- PLEXUS_HOME=`dirname "$PRG"`/..
-
- # make it fully qualified
- PLEXUS_HOME=`cd "$PLEXUS_HOME" && pwd`
-
- cd $saveddir
-fi
+# Get standard environment variables
+PRGDIR=`dirname "$THIS_PROG"`
+PLEXUS_HOME=`cd "$PRGDIR/.." ; pwd`
+PLEXUS_CONF=`cd "$PLEXUS_HOME/conf" ; pwd`
+unset THIS_PROG
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
@@ -65,6 +51,11 @@
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
@@ -103,7 +94,19 @@
TOOLS_JAR="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes/classes.jar"
fi
-MAIN_CLASS=com.werken.classworlds.Launcher
+# ----- 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 \
@@ -112,4 +115,4 @@
-Dlib=${PLEXUS_HOME}/lib \
-Dtools.jar=$TOOLS_JAR \
-Dplexus.home=${PLEXUS_HOME} \
- $MAIN_CLASS $@
+ $MAIN_CLASS ${CONF}