Resin 2 EE Application Server Module

Public Targets

TargetDescription
deploydeploys archive to resin
undeployremoves archive from resin deploy folder
fdeploycopy deployment folder to resin
fundeployremoves deployment folder from resin
jspccompile JSPs - not implemented
appcgenerate/compile JSP support files - not implemented
startstart resin server
stopstop resin server

Source: appserver-resin2.xml

				<?xml version="1.0" encoding="UTF-8"?>
<project name="appserver" default="default" basedir=".">
	<description>
  + ==\_/============J=A=V=A=G=E=N===A=N=T===M=O=D=U=L=E=S================= +
  +  \(_)/                                                                  +
  +  -(_)-           Resin 2 EE Application Server Module                   +
  +  /(_)\                                                                  +
  + ======================================================================= +
  +    Copyright (c) 2002-2005 Outsource Cafe, Inc.  All rights reserved.   +
  + ======================================================================= +
  +
  + This file defines Resin 2.x properties and targets.
  +
  + Public targets: 
  +    deploy      - deploys distribution file to application server
  +    undeploy    - removes distribution file from application server
  +    fdeploy     - folder deploy expands distribution files on server
  +    fundeploy   - folder undeploy removes expaned directory from server
  +    start       - starts application server
  +    stop        - stops application server
  +
  + Required properties:
  +   dist.name    - the distribution file name, should be predefined.
  +   dist.dir     - the loaction of jar/war files, should be predefined.
  + 
  + todo: start/stop targets need work, property cleanup
  +
  + developer: RichardEasterling@OutsourceCafe.com
  + ======================================================================= +
  + Licensed under the Apache License, Version 2.0 (the "License");
  + you may not use this file except in compliance with the License.
  + You may obtain a copy of the License at
  +
  +   http://www.apache.org/licenses/LICENSE-2.0
  +
  + Unless required by applicable law or agreed to in writing, software
  + distributed under the License is distributed on an "AS IS" BASIS,
  + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + See the License for the specific language governing permissions and
  + limitations under the License.
  + =J=A=M===========================================J=A=V=A=G=E=N=.=C=O=M= +
   </description>
	<property name="APPSERVER.PRESENT" value="true"></property>
	<property name="RESIN3.PRESENT" value="true"></property>
	<!-- =================================================================== -->
	<!-- public targets: -->
	<!-- =================================================================== -->
	<target name="deploy" depends="-deploy" description="deploys archive to resin"></target>
	<target name="undeploy" depends="-undeploy" description="removes archive from resin deploy folder"></target>
	<target name="fdeploy" depends="-fdeploy" description="copy deployment folder to resin"></target>
	<target name="fundeploy" depends="-fundeploy" description="removes deployment folder from resin"></target>
	<target name="jspc" depends="" description="compile JSPs - not implemented"></target>
	<target name="appc" depends="" description="generate/compile JSP support files - not implemented"></target>
	<target name="start" depends="started, -start" description="start resin server"></target>
	<target name="stop" depends="stopped, -stop" description="stop resin server"></target>
	<!-- ==================================================================== -->
	<!-- Resin properties and sanity checks: -->
	<!-- ==================================================================== -->
	<condition property="resin.home" value="${env.RESIN_HOME}">
		<isset property="env.RESIN_HOME"></isset>
	</condition>
	<fail unless="resin.home">'resin.home' is not set. Set the 'resin.home' property or create an environmental variable called 'RESIN_HOME' pointing to the top-level Resin installation directory.</fail>
	<available property="resin.jar.present" file="${resin.home}/lib/resin.jar"></available>
	<fail unless="resin.jar.present">"RESIN_HOME" is set but it does not seem to point to the right directory. The file "resin.jar" must be available at RESIN_HOME/lib.</fail>

	<property name="resin.version" value="2.1.9"></property>
	<property name="resin.lib" location="${resin.home}/lib"></property>
	<property name="resin.client.jar" location="${resin.lib}/resin-ejb.jar"></property>
	<!-- global app server settings -->
	<property name="appserver.name" value="Resin EE"></property>
	<property name="appserver.version" value="2.1.x"></property>
	<property name="appserver.deploy.dir" location="${resin.home}/webapps"></property>
	<!-- log.folder is relative to RESIN_HOME folder -->
	<property name="appserver.log.folder" value="log/"></property>
	<!-- global app server settings -->
	<property name="appserver.http.port" value="8080"></property>
	<property name="appserver.host" value="localhost"></property>
	<property name="appserver.start.delay" value="45"></property>
	<property name="appserver.deploy.delay" value="15"></property>
	<!-- db settings 
	<property name="resin.datasource.name" value="java:/DefaultDS"/>
	<property name="resin.type.mapping" value="Hypersonic SQL"/>
	-->
	<!-- override jspc properties: 
	<property name="build.jspc.java.folder" location="work"/>
	<property name="build.jspc.classes.dir" location="${build.jspc.java.dir}"/>
	-->
	<!-- Resin wants to see the namespaces for tag libraries -->
	<property name="web.jsp.namespaces" value="true"></property>
	<!-- ==================================================================== -->
	<!-- Resin client properties: -->
	<!-- ==================================================================== -->
	<!--
	<jndi-factory>com.caucho.ejb.BurlapContextFactory</jndi-factory>
   <init-param java.naming.provider.url="http://localhost:8080/cmp/example"/>
	<property name="appserver.java.naming.provider.url" value="jnp://localhost:1099"/>
	<property name="appserver.java.naming.factory.initial" value="com.caucho.burlap.BurlapContextFactory"/>
	-->
	<property name="appserver.java.naming.factory.initial" value="com.caucho.naming.InitialContextFactoryImpl"></property>
	<property name="appserver.java.naming.provider.url" value="http://localhost:8080/cmp"></property>
	<property name="appserver.java.naming.factory.url.pkgs" value="com.caucho.naming"></property>
	<path id="appserver.client.classpath">
		<fileset dir="${resin.lib}">
			<include name="*.jar"></include>
		</fileset>
	</path>
	<!-- =================================================================== -->
	<!-- deploy archive (jar/war/ear) to server -->
	<!-- =================================================================== -->
	<target name="-deploy">
		<copy todir="${appserver.deploy.dir}">
			<fileset dir="${dist.dir}" includes="${dist.name}"></fileset>
		</copy>
	</target>
	<!-- =================================================================== -->
	<!-- remove archive (jar/war/ear) from server -->
	<!-- =================================================================== -->
	<target name="-undeploy">
		<delete file="${appserver.deploy.dir}/${dist.name}"></delete>
	</target>
	<!-- =================================================================== -->
	<!-- deploy files to server -->
	<!-- =================================================================== -->
	<target name="-fdeploy">
		<mkdir dir="${appserver.deploy.dir}/${dist.name}"></mkdir>
		<unzip src="${dist.file}" dest="${appserver.deploy.dir}/${dist.name}"></unzip>
	</target>
	<!-- =================================================================== -->
	<!-- remove deployment files from server - server must be stopped -->
	<!-- =================================================================== -->
	<target name="-fundeploy">
		<delete dir="${appserver.deploy.dir}/${dist.name}"></delete>
	</target>
	<!-- =================================================================== -->
	<!-- start resin -->
	<!-- =================================================================== -->
	<target name="-start" unless="server.started">
		<fail>Resin must be started manually...</fail>
		<!--
		<java classname="com.caucho.server.http.ResinServer" fork="yes">
			<arg line="-conf resin.conf"/>
			<arg line="start"/>
			<classpath>
				<path refid="appserver.client.classpath"/>
				<pathelement location="${tools.jar}"/>
			</classpath>
		</java>
		-->
	</target>
	<!-- =================================================================== -->
	<!-- sets 'server.started' if server is running -->
	<!-- =================================================================== -->
	<target name="started">
		<condition property="server.started">
			<and>
				<socket port="${appserver.http.port}" server="${appserver.host}"></socket>
			</and>
		</condition>
		<echo>server.started = ${server.started}</echo>
	</target>
	<!-- =================================================================== -->
	<!-- stop resin -->
	<!-- =================================================================== -->
	<target name="-stop" if="can.end">
		<echo>NOT IMPLEMENTED</echo>
		<!--
		<java classname="com.caucho.server.http.ResinServer" fork="yes">
			<arg line="-conf resin.conf"/>
			<arg line="stop"/>
			<classpath>
				<path refid="appserver.client.classpath"/>
				<pathelement location="${tools.jar}"/>
			</classpath>
		</java>
		<echo>sleeping 4s...</echo>
		<sleep seconds="4"/>
		-->
	</target>
	<!-- =================================================================== -->
	<!-- sets 'can.end' if server running and not 'server.started -->
	<!-- avoiding stops on servers up before testcycle initiation -->
	<!-- =================================================================== -->
	<target name="stopped">
		<condition property="can.end">
			<and>
				<socket port="${appserver.http.port}" server="${appserver.host}"></socket>
				<not>
					<isset property="server.started"></isset>
				</not>
			</and>
		</condition>
		<echo>can.end = ${can.end}</echo>
	</target>
</project>