Files
maven-plugins/webserver/src/plugin-resources/apache-2.x.jelly
T
plynch 31f11f1b4a Recovery of changes made before the big plugin overhaul
plugin.jelly
o extraneous markup removed
o improved logging
o improved filters for goals that copy
o added ability for each webserver to have a clean target

plugin.properties
o adding maven.webserver.root which says where to serve documents from

apache-2.x.jelly
o add goals that start apache for Windows NT/XP/2000
o add a clean goal to cleanup installed services


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@112737 13f79535-47bb-0310-9956-ffa450edef68
2003-01-25 10:04:04 +00:00

231 lines
8.4 KiB
XML

<?xml version="1.0"?>
<project xmlns:j="jelly:core" xmlns:log="jelly:log" xmlns:ant="jelly:ant">
<goal name="webserver:apache-2.x-reqs"
description="Intialize resources for apache processing">
<!-- Check if user has http.conf in a conf dir -->
<ant:available file="${maven.webserver.conf.dir}/conf/httpd.conf"
type="file" property="maven.webserver.apache2x.has.conf" value="true" />
<ant:fail unless="maven.webserver.apache2x.has.conf">
To use this webserver, you must have a project specific
configuration file at the following location:
${maven.webserver.conf.dir}/conf/httpd.conf
</ant:fail>
<ant:property name="maven.webserver.apache.executable"
location="${maven.webserver.home}/bin/apache" />
<ant:property name="maven.webserver.apache.httpd.conf"
location="${maven.webserver.dir}/conf/httpd.conf" />
<j:set var="osName" value="${context.getVariable('os.name')}" />
<!-- TODO - only run this for Windows NT/2000/XP -->
<j:set var="maven.webserver.apache2x.service.name"
value="${context.getVariable('user.name')}-maven-webserver-${pom.getId()}" />
</goal>
<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:filterset refid="maven.webserver.filterset" />
</ant:copy>
<!-- try to install the service for this project on Windows NT/2000/XP -->
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="Windows 2000">
<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>
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="Windows NT">
<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>
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="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>
<!-- 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> -->
</goal>
<goal name="webserver:start-apache-2.x" description="Start Apache 2.x"
prereqs="webserver:apache-2.x-reqs" >
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="Windows 2000">
<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 start" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="Windows NT">
<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 start" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="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 start" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
</goal>
<goal name="webserver:restart-apache-2.x" description="Restart Apache 2.x"
prereqs="webserver:apache-2.x-reqs" >
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="Windows 2000">
<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 restart" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="Windows NT">
<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 restart" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="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 restart" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
</goal>
<goal name="webserver:stop-apache-2.x" description="Stop Apache 2.x"
prereqs="webserver:apache-2.x-reqs" >
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="Windows 2000">
<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 stop" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="Windows NT">
<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 stop" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="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 stop" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
</goal>
<goal name="webserver:clean-apache-2.x" description="Clean Apache 2.x"
prereqs="webserver:apache-2.x-reqs" >
<!-- to clean up on windows uninstall the service -->
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="Windows 2000">
<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 uninstall" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="Windows NT">
<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 uninstall" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
<ant:exec executable="${maven.webserver.home}\bin\apache.exe"
os="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 uninstall" />
<ant:arg line="-n ${maven.webserver.apache2x.service.name}" />
</ant:exec>
</goal>
</project>