o cleaning up reinstall and install goals into a dyna tag

The reason is the only difference is on a reinstall we want to force the copy of conf files, where an install doesn't force.
o general cleanup
o now implements restart and reinstall goals correctly


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113382 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
plynch 2003-04-24 18:43:54 +00:00
parent e177700327
commit 4d0047df0c

View File

@ -1,6 +1,8 @@
<?xml version="1.0"?>
<project xmlns:j="jelly:core" xmlns:log="jelly:log" xmlns:ant="jelly:ant">
<project xmlns:j="jelly:core" xmlns:log="jelly:log" xmlns:ant="jelly:ant"
xmlns:apache2x="http://www.maven.org/plugin/webserver/apache2x"
xmlns:define="jelly:define" >
<goal name="webserver:apache-2.x-reqs"
description="Intialize resources for apache processing">
@ -27,51 +29,75 @@ ${maven.webserver.conf.dir}/conf/httpd.conf
value="${context.getVariable('user.name')}-maven-webserver-${pom.getId()}" />
</j:if>
<define:taglib uri="http://www.maven.org/plugin/webserver/apache2x">
<!-- accept the force property with a value of true or false -->
<define:tag name="install">
<j:if test="${force == 'false'}">
<!-- Create common directories and copy configuration files -->
<ant:mkdir dir="${maven.webserver.dir}/logs"/>
<ant:mkdir dir="${maven.webserver.dir}/conf"/>
<ant:mkdir dir="${maven.webserver.root}"/>
</j:if>
<!-- copy any user configuration files w/ filtering by forcing copy -->
<!-- if reinstall -->
<ant:copy todir="${maven.webserver.dir}" overwrite="${force}">
<ant:fileset dir="${maven.webserver.conf.dir}" />
<ant:filterset refid="maven.webserver.filterset.default" />
</ant:copy>
<j:if test="${systemScope['os.name'].startsWith('Windows') and force == 'false'}">
<!-- try to install the service for this project on Windows NT/2000/XP -->
<!-- Windows 98/ME don't use a service -->
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="Windows NT,Windows 2000,Windows XP">
<ant:arg value="-d" />
<ant:arg line="${maven.webserver.root}" />
<ant:arg value="-f" />
<ant:arg line="${maven.webserver.dir}\conf\httpd.conf" />
<ant:arg line="-k install" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
</j:if>
<!-- TBD - should I install a helper script for each install??? -->
<!-- <ant:copy file="${plugin.dir}/apache-2.x.bat"
tofile="${maven.webserver.dir}/apache.bat" overwrite="true">
<ant:filterset refid="maven.webserver.filterset.default" />
<ant:filterset refid="maven.webserver.filterset" />
</ant:copy> -->
</define:tag>
</define:taglib>
</goal>
<!--==================================================================-->
<!-- R E I N S T A L L -->
<!--==================================================================-->
<goal name="webserver:reinstall-apache-2.x"
prereqs="webserver:apache-2.x-reqs" description="Reinstall Apache 2.x">
<apache2x:install force="true"/>
</goal>
<!--==================================================================-->
<!-- I N S T A L L -->
<!--==================================================================-->
<goal name="webserver:install-apache-2.x" prereqs="webserver:apache-2.x-reqs"
description="Install Apache 2.x">
<!-- Create common directories and copy configuration files -->
<ant:mkdir dir="${maven.webserver.dir}/logs"/>
<ant:mkdir dir="${maven.webserver.dir}/conf"/>
<ant:mkdir dir="${maven.webserver.root}"/>
<!-- copy any user configuration files w/ filtering by forcing copy -->
<!-- expecting at least a httpd.conf -->
<ant:copy todir="${maven.webserver.dir}" overwrite="true">
<ant:fileset dir="${maven.webserver.conf.dir}" />
<ant:filterset refid="maven.webserver.filterset.default" />
</ant:copy>
<j:if test="${systemScope['os.name'].startsWith('Windows')}">
<!-- try to install the service for this project on Windows NT/2000/XP -->
<!-- Windows 98/ME don't use a service -->
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="Windows NT,Windows 2000,Windows XP">
<ant:arg value="-d" />
<ant:arg line="${maven.webserver.root}" />
<ant:arg value="-f" />
<ant:arg line="${maven.webserver.dir}\conf\httpd.conf" />
<ant:arg line="-k install" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
</j:if>
<!-- TBD - should I install a helper script for each install??? -->
<!-- <ant:copy file="${plugin.dir}/apache-2.x.bat"
tofile="${maven.webserver.dir}/apache.bat" overwrite="true">
<ant:filterset refid="maven.webserver.filterset.default" />
<ant:filterset refid="maven.webserver.filterset" />
</ant:copy> -->
<apache2x:install force="false"/>
</goal>
<goal name="webserver:start-apache-2.x" description="Start Apache 2.x"
prereqs="webserver:apache-2.x-reqs" >
<j:choose>
<!--==================================================================-->
<!-- S T A R T -->
<!--==================================================================-->
<goal name="webserver:start-apache-2.x" prereqs="webserver:apache-2.x-reqs"
description="Start Apache 2.x" >
<j:choose>
<j:when test="${systemScope['os.name'].startsWith('Windows')}">
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
@ -129,6 +155,9 @@ Missing service detected. Trying to install a new webserver instance service...
</j:choose>
</goal>
<!--==================================================================-->
<!-- R E S T A R T -->
<!--==================================================================-->
<goal name="webserver:restart-apache-2.x" description="Restart Apache 2.x"
prereqs="webserver:apache-2.x-reqs" >
@ -158,6 +187,9 @@ Missing service detected. Trying to install a new webserver instance service...
</j:choose>
</goal>
<!--==================================================================-->
<!-- S T O P -->
<!--==================================================================-->
<goal name="webserver:stop-apache-2.x" description="Stop Apache 2.x"
prereqs="webserver:apache-2.x-reqs" >
@ -189,6 +221,9 @@ Missing service detected. Trying to install a new webserver instance service...
</j:choose>
</goal>
<!--==================================================================-->
<!-- C L E A N -->
<!--==================================================================-->
<goal name="webserver:clean-apache-2.x" description="Clean Apache 2.x"
prereqs="webserver:apache-2.x-reqs" >