beehive/ant/jonas-imports.xml

125 lines
5.3 KiB
XML
Raw Normal View History

<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
$Header:$
-->
<project name="jonas-imports" default="" basedir=".">
<property environment="os"/>
<property name="jonas.root" location="${os.JONAS_ROOT}"/>
<property name="jonas.deploy.dir" location="${jonas.root}/webapps"/>
<!-- Properties used to run JOnAS -->
<path id="appserver.build.classpath">
<fileset dir="${jonas.root}/lib/catalina/common/lib">
<include name="*.jar"/>
</fileset>
</path>
<target name="deploy" description="Deploy a webapp to a running Jonas server">
<fail unless="context.path" message="Can't deploy webapp; the value ${context.path} was unspecified"/>
<fail unless="webapp.dir" message="Can't deploy webapp; the value ${webapp.dir} was unspecified"/>
<available property="webapp.available" file="${webapp.dir}" type="dir"/>
<fail unless="webapp.available" message="The webapp at ${webapp.dir} does not exist."/>
<echo>deploy webapp from ${webapp.dir} with context path ${context.path}</echo>
<jar destfile="${jonas.deploy.dir}/${context.path}.war"
basedir="${webapp.dir}" />
<echo>deploying via jonas admin</echo>
<exec os="Windows 2000,Windows 2003,Windows XP" dir="${jonas.root}\bin\nt" executable="jonas.bat">
<env key="JONAS_ROOT" value="${jonas.root}"/>
<arg line="/c jonas.bat admin -a ${context.path}.war"/>
</exec>
<exec os="Linux,SunOS,Solaris,Mac OS X" dir="${jonas.root}/bin/unix" executable="sh">
<env key="JONAS_ROOT" value="${jonas.root}"/>
<arg line="jonas admin -a ${context.path}.war"/>
</exec>
</target>
<target name="undeploy" description="Undeploy a webapp running on a Jonas server">
<fail unless="context.path" message="Can't undeploy webapp; the
value ${context.path} was unspecified"/>
<echo>undeploying via jonas admin</echo>
<exec os="Windows 2000,Windows 2003,Windows XP" dir="${jonas.root}\bin\nt" executable="jonas.bat">
<env key="JONAS_ROOT" value="${jonas.root}"/>
<arg line="/c jonas.bat admin -r ${context.path}.war"/>
</exec>
<exec os="Linux,SunOS,Solaris,Mac OS X" dir="${jonas.root}/bin/unix" executable="sh">
<env key="JONAS_ROOT" value="${jonas.root}"/>
<arg line="jonas admin -r ${context.path}.war"/>
</exec>
<delete file="${jonas.deploy.dir}/${context.path}.war" />
</target>
<target name="redeploy" description="Redeploy a webapp already running on a JOnAS server">
<antcall target="undeploy" />
<antcall target="deploy" />
</target>
<target name="start" description="Start a Jonas instance.">
<condition property="cmdline.options" value="">
<not><isset property="cmdline.options"/></not>
</condition>
<condition property="java.options" value="">
<not><isset property="java.options"/></not>
</condition>
<echo>startup.dir: ${jonas.root}</echo>
<echo>cmdline.options: ${cmdline.options}</echo>
<echo>java.options: ${java.options}</echo>
<echo>Start Jonas</echo>
<exec os="Windows 2000,Windows 2003,Windows XP" dir="${jonas.root}\bin\nt" executable="jonas.bat">
<env key="JONAS_ROOT" value="${jonas.root}"/>
<env key="JAVA_OPTS" value="${java.options}"/>
<arg line="/c jonas.bat start ${cmdline.options}"/>
</exec>
<exec os="Linux,SunOS,Solaris,Mac OS X" dir="${jonas.root}/bin/unix" executable="sh">
<env key="JONAS_ROOT" value="${jonas.root}"/>
<env key="JAVA_OPTS" value="${java.options}"/>
<arg line="jonas start ${cmdline.options}"/>
</exec>
</target>
<target name="start.with.shmem" description="Start a JOnAS instance with shared memory debugging.">
<echo>shmem is not an option for JOnAS. starting normally...</echo>
<antcall target="start" />
</target>
<target name="stop" description="Stop the NetUI server">
<echo>Stop Jonas in: ${jonas.root}</echo>
<exec os="Windows 2000,Windows 2003,Windows XP" dir="${jonas.root}\bin\nt" executable="jonas.bat">
<env key="JONAS_ROOT" value="${jonas.root}"/>
<arg line="/c jonas.bat stop"/>
</exec>
<exec os="Linux,SunOS,Solaris,Mac OS X" dir="${jonas.root}/bin/unix" executable="sh">
<env key="JONAS_ROOT" value="${jonas.root}"/>
<arg line="jonas stop"/>
</exec>
</target>
</project>