nbproject/ant-deploy.xml

Sun, 29 Oct 2017 13:35:43 +0100

author
mike@uapl02
date
Sun, 29 Oct 2017 13:35:43 +0100
changeset 3
acf54d3fa1d1
parent 0
ad22b29e3a40
permissions
-rw-r--r--

switched to tomcat 8.5 (should be developed this way for maximum compatibility)

universe@0 1 <?xml version="1.0" encoding="UTF-8"?>
mike@3 2 <!--
mike@3 3 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
mike@3 4
mike@3 5 Copyright (c) 2006, 2016 Oracle and/or its affiliates. All rights reserved.
mike@3 6
mike@3 7 Oracle and Java are registered trademarks of Oracle and/or its affiliates.
mike@3 8 Other names may be trademarks of their respective owners.
mike@3 9
mike@3 10 The contents of this file are subject to the terms of either the GNU
mike@3 11 General Public License Version 2 only ("GPL") or the Common
mike@3 12 Development and Distribution License("CDDL") (collectively, the
mike@3 13 "License"). You may not use this file except in compliance with the
mike@3 14 License. You can obtain a copy of the License at
mike@3 15 http://www.netbeans.org/cddl-gplv2.html
mike@3 16 or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
mike@3 17 specific language governing permissions and limitations under the
mike@3 18 License. When distributing the software, include this License Header
mike@3 19 Notice in each file and include the License file at
mike@3 20 nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
mike@3 21 particular file as subject to the "Classpath" exception as provided
mike@3 22 by Oracle in the GPL Version 2 section of the License file that
mike@3 23 accompanied this code. If applicable, add the following below the
mike@3 24 License Header, with the fields enclosed by brackets [] replaced by
mike@3 25 your own identifying information:
mike@3 26 "Portions Copyrighted [year] [name of copyright owner]"
mike@3 27
mike@3 28 If you wish your version of this file to be governed by only the CDDL
mike@3 29 or only the GPL Version 2, indicate your decision by adding
mike@3 30 "[Contributor] elects to include this software in this distribution
mike@3 31 under the [CDDL or GPL Version 2] license." If you do not indicate a
mike@3 32 single choice of license, a recipient has the option to distribute
mike@3 33 your version of this file under either the CDDL, the GPL Version 2 or
mike@3 34 to extend the choice of license to its licensees as provided above.
mike@3 35 However, if you add GPL Version 2 code and therefore, elected the GPL
mike@3 36 Version 2 license, then the option applies only if the new code is
mike@3 37 made subject to such option by the copyright holder.
mike@3 38
mike@3 39 Contributor(s):
mike@3 40 -->
universe@0 41 <project default="-deploy-ant" basedir=".">
mike@3 42 <target name="-init" if="deploy.ant.enabled">
mike@3 43 <property file="${deploy.ant.properties.file}"/>
mike@3 44 <tempfile property="temp.module.folder" prefix="tomcat" destdir="${java.io.tmpdir}"/>
mike@3 45 <unwar src="${deploy.ant.archive}" dest="${temp.module.folder}">
mike@3 46 <patternset includes="META-INF/context.xml"/>
mike@3 47 </unwar>
mike@3 48 <xmlproperty file="${temp.module.folder}/META-INF/context.xml"/>
mike@3 49 <delete dir="${temp.module.folder}"/>
universe@0 50 </target>
mike@3 51 <target name="-check-credentials" if="deploy.ant.enabled" depends="-init">
mike@3 52 <fail message="Tomcat password has to be passed as tomcat.password property.">
mike@3 53 <condition>
mike@3 54 <not>
mike@3 55 <isset property="tomcat.password"/>
mike@3 56 </not>
mike@3 57 </condition>
mike@3 58 </fail>
universe@0 59 </target>
mike@3 60 <target name="-deploy-ant" if="deploy.ant.enabled" depends="-init,-check-credentials">
mike@3 61 <echo message="Deploying ${deploy.ant.archive} to ${Context(path)}"/>
mike@3 62 <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
mike@3 63 classpath="${tomcat.home}/server/lib/catalina-ant.jar"/>
mike@3 64 <deploy url="${tomcat.url}/manager" username="${tomcat.username}"
mike@3 65 password="${tomcat.password}" path="${Context(path)}"
mike@3 66 war="${deploy.ant.archive}"/>
mike@3 67 <property name="deploy.ant.client.url" value="${tomcat.url}${Context(path)}"/>
universe@0 68 </target>
mike@3 69 <target name="-undeploy-ant" if="deploy.ant.enabled" depends="-init,-check-credentials">
mike@3 70 <echo message="Undeploying ${Context(path)}"/>
mike@3 71 <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
mike@3 72 classpath="${tomcat.home}/server/lib/catalina-ant.jar"/>
mike@3 73 <undeploy url="${tomcat.url}/manager" username="${tomcat.username}"
mike@3 74 password="${tomcat.password}" path="${Context(path)}"/>
universe@0 75 </target>
universe@0 76 </project>

mercurial