git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113407 13f79535-47bb-0310-9956-ffa450edef68
252 lines
6.8 KiB
XML
252 lines
6.8 KiB
XML
<project
|
|
xmlns:j="jelly:core"
|
|
xmlns:maven="jelly:maven"
|
|
xmlns:util="jelly:util"
|
|
xmlns:define="jelly:define"
|
|
xmlns:deploy="deploy"
|
|
xmlns:sea="sea"
|
|
xmlns:velocity="jelly:org.apache.commons.jelly.tags.velocity.VelocityTagLibrary"
|
|
xmlns:plexus="runner">
|
|
|
|
<!-- ===================================================================== -->
|
|
<!-- D E P L O Y P L E X U S -->
|
|
<!-- ===================================================================== -->
|
|
<!-- Deploys Plexus into a self-contained directory that allows you -->
|
|
<!-- to run Plexus easily. -->
|
|
<!-- ===================================================================== -->
|
|
|
|
<!--
|
|
|
|
|
| We need a way to customize the configuration process.
|
|
|
|
|
-->
|
|
|
|
|
|
<!--
|
|
|
|
|
| Plexus Dynamic TagLibarary
|
|
|
|
|
| o Create a plexus project.
|
|
| o Create a runtime based on a configuration.
|
|
| o Update the runtime based on an updated configuration.
|
|
| o Generate a reactor for component builds.
|
|
| o Generate a stub component with testing facilities.
|
|
| o Leave hooks for processes to allow for things like insertion of webapps
|
|
| or other artifacts that are the product of another build.
|
|
| o Generate reports on the state of the overall project.
|
|
|
|
|
-->
|
|
|
|
<define:taglib uri="runner">
|
|
|
|
<!--
|
|
|
|
|
| @base
|
|
| @conf
|
|
| @confDir
|
|
| @modelPom
|
|
| @plexusPomFile
|
|
| @configurationProperties
|
|
|
|
|
-->
|
|
|
|
<define:tag name="deploy">
|
|
|
|
<j:set
|
|
var="templatePath"
|
|
value="${pom.getPluginContext('maven-plexus-plugin').getVariable('plugin.dir')}/plugin-resources/templates"/>
|
|
|
|
<j:set
|
|
var="launcherConfiguration"
|
|
value="classworlds.conf"/>
|
|
|
|
<j:set
|
|
var="launcherConfigurationTemplate"
|
|
value="classworlds.vm"/>
|
|
|
|
<runner:create-directory-structure
|
|
base="${base}"/>
|
|
|
|
<runner:assemble-plexus-dependencies
|
|
plexusPomFile="${plexusPomFile}"
|
|
plexusCoreLibDirectory="${base}/lib"/>
|
|
|
|
<runner:create-classworlds-configuration
|
|
plexusPom="${plexusPomFile}"
|
|
templatePath="${templatePath}"
|
|
classWorldsConfiguration="${base}/conf/${launcherConfiguration}"
|
|
classWorldsConfigurationTemplate="${launcherConfigurationTemplate}"/>
|
|
|
|
<runner:create-launcher-scripts
|
|
templatePath="${templatePath}"
|
|
unixScript="${base}/bin/plexus.sh"
|
|
windowsScript="${base}/bin/plexus.bat"/>
|
|
|
|
<runner:package-java-runtime
|
|
jreDirectory="${base}/jre"/>
|
|
|
|
</define:tag>
|
|
|
|
<define:tag name="create-directory-structure">
|
|
|
|
<delete dir="${base}"/>
|
|
|
|
<mkdir dir="${base}/bin"/>
|
|
<mkdir dir="${base}/conf"/>
|
|
<mkdir dir="${base}/components"/>
|
|
<mkdir dir="${base}/lib"/>
|
|
<mkdir dir="${base}/app-lib"/>
|
|
<mkdir dir="${base}/work"/>
|
|
|
|
</define:tag>
|
|
|
|
<!--
|
|
|
|
|
| Copy any Plexus/Application configuration files.
|
|
|
|
|
-->
|
|
<define:tag name="process-configurations">
|
|
|
|
<util:properties
|
|
file="${configurationProperties}"
|
|
var="appProperties"/>
|
|
|
|
<copy
|
|
todir="${destinationDirectory}"
|
|
overwrite="true"
|
|
filtering="on">
|
|
<fileset dir="${sourceDirectory}"/>
|
|
<filterset>
|
|
<j:forEach var="appProperty" items="${appProperties.keys()}">
|
|
<util:replace var="token" oldChar="." newChar="_" value="${appProperty}"/>
|
|
<j:set var="token" value="${token.toUpperCase()}"/>
|
|
<j:set var="propertyName" value="${appProperty}" />
|
|
<j:set var="propertyValue" value="${appProperties.getProperty(propertyName)}"/>
|
|
<filter token="${token}" value="${propertyValue}"/>
|
|
</j:forEach>
|
|
</filterset>
|
|
</copy>
|
|
|
|
</define:tag>
|
|
|
|
<define:tag name="assemble-plexus-dependencies">
|
|
|
|
<maven:pom
|
|
projectDescriptor="${plexusPomFile}"
|
|
var="plexusPom"/>
|
|
|
|
<j:set
|
|
var="plexusJar"
|
|
value="${maven.repo.local}/plexus/jars/${plexusPom.artifactId}-${plexusPom.currentVersion}.jar"/>
|
|
|
|
<util:available file="${plexusJar}">
|
|
<j:set var="plexusJarPresent" value="true"/>
|
|
<copy file="${plexusJar}" todir="${plexusCoreLibDirectory}"/>
|
|
</util:available>
|
|
|
|
<j:if test="${plexusJarPresent != 'true'}">
|
|
<get
|
|
src="http://www.ibiblio.org/maven/plexus/jars/${plexusPom.artifactId}-${plexusPom.currentVersion}.jar"
|
|
dest="${plexusCoreLibDirectory}"/>
|
|
</j:if>
|
|
|
|
<!--
|
|
|
|
|
| Now we need to pull down Plexus' dependencies to satisfy runtime
|
|
| requirements.
|
|
|
|
|
-->
|
|
|
|
<echo>Retrieving any missing Plexus dependencies ... </echo>
|
|
|
|
${plexusPom.verifyDependencies()}
|
|
|
|
<!-- Copy the plexus dependencies into the runtime lib/. -->
|
|
|
|
<deploy:copy-deps
|
|
projectDescriptor="${plexusPomFile}"
|
|
todir="${plexusCoreLibDirectory}"
|
|
excludes="junit"/>
|
|
|
|
</define:tag>
|
|
|
|
<!--
|
|
|
|
|
| @plexusPom
|
|
| @templatePath
|
|
| @classWorldsConfiguration
|
|
| @classWorldsConfigurationTemplate
|
|
|
|
|
-->
|
|
<define:tag name="create-classworlds-configuration">
|
|
|
|
<echo>
|
|
@plexusPom = ${plexusPom}
|
|
@templatePath = ${templatePath}
|
|
@classWorldsConfiguration = ${classWorldsConfiguration}
|
|
@classWorldsConfigurationTemplate = ${classWorldsConfigurationTemplate}
|
|
</echo>
|
|
|
|
<maven:pom
|
|
projectDescriptor="${plexusPom}"
|
|
var="project"/>
|
|
|
|
<velocity:merge
|
|
name="${classWorldsConfiguration}"
|
|
basedir="${templatePath}"
|
|
template="${classWorldsConfigurationTemplate}"/>
|
|
|
|
</define:tag>
|
|
|
|
<!--
|
|
|
|
|
| @templatePath
|
|
| @unixScript
|
|
| @windowsScript
|
|
|
|
|
-->
|
|
<define:tag name="create-launcher-scripts">
|
|
|
|
<echo>
|
|
@templatePath = ${templatePath}
|
|
@unixScript = ${unixScript}
|
|
@windowsScript = ${windowsScript}
|
|
</echo>
|
|
|
|
<velocity:merge
|
|
name="${unixScript}"
|
|
basedir="${templatePath}"
|
|
template="plexus.vm"/>
|
|
|
|
<velocity:merge
|
|
name="${windowsScript}"
|
|
basedir="${templatePath}"
|
|
template="plexus-bat.vm"/>
|
|
|
|
<chmod file="${unixScript}" perm="+x"/>
|
|
|
|
</define:tag>
|
|
|
|
<!--
|
|
|
|
|
| Include the JRE if specified. This is useful for applications
|
|
| that need to be completely self-contained.
|
|
|
|
|
-->
|
|
<define:tag name="package-java-runtime">
|
|
|
|
<j:if test="${jre == 'true'}">
|
|
<exec
|
|
executable="cp">
|
|
<arg value="-r"/>
|
|
<arg value="${java.home}"/>
|
|
<arg value="${jreDirectory}"/>
|
|
</exec>
|
|
</j:if>
|
|
|
|
</define:tag>
|
|
|
|
</define:taglib>
|
|
|
|
</project>
|