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