blob: 28ef70547a1b71ae699fae108ee85a5ac64cdb28 [file]
<!--
Copyright 2004 The Apache Software Foundation.
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.
-->
<project default="deployTestsuite"
xmlns:j="jelly:core"
xmlns:maven="jelly:maven"
xmlns:ant="jelly:ant">
<!--
<preGoal name="war">
<maven:reactor
basedir="${pluto.testsuite.dir}"
includes="project.xml"
goals="war:war"
postProcessing="false"
ignoreFailures="false"/>
</preGoal>
-->
<!-- The multiproject won't let us call war directly, we must specify
since it won't be set by war goal. -->
<preGoal name="deployTestsuite">
<j:set var="maven.war.final.name" value="testsuite.war"/>
</preGoal>
<goal name="deployTestsuite">
<java classname="org.apache.pluto.portalImpl.Deploy" fork="yes">
<classpath>
<path refid="maven.dependency.classpath"/>
<pathelement path="${maven.build.dest}"/>
</classpath>
<arg value="${maven.tomcat.home}/webapps"/>
<arg value="pluto"/>
<arg value="${basedir}/target/${maven.war.final.name}"/>
<arg value=".."/>
</java>
</goal>
<preGoal name="tomcat:deploy">
<j:set var="maven.war.final.name" value="testsuite.war"/>
</preGoal>
<goal name="tomcat:init">
<j:set var="vers" value="${maven.tomcat.version.major}"/>
<j:if test="${vers==null}">
<ant:available property="maven.tomcat.version.major"
value="5"
type="file"
file="${maven.tomcat.home}/conf/Catalina/admin.xml"/>
</j:if>
<j:set var="vers" value="${maven.tomcat.version.major}"/>
<j:if test="${vers==null}">
<ant:available property="maven.tomcat.version.major"
value="5"
type="file"
file="${maven.tomcat.home}/webapps/admin.xml"/>
</j:if>
<j:set var="depl" value="${maven.tomcat.deploy}"/>
<j:if test="${depl != 'exploded'}">
<j:set var="maven.tomcat.deploy" value="war"/>
</j:if>
<echo>Deploying to Tomcat:
Location: ${maven.tomcat.home}
Major Version: ${maven.tomcat.version.major}
Hosts: ${maven.tomcat.host}
Context Config: ${maven.tomcat.context.config}
Deploy Type: ${maven.tomcat.deploy}
</echo>
</goal>
<goal name="tomcat:deploy">
<j:set var="depType" value="${maven.tomcat.deploy}"/>
<j:if test="${depType=='exploded'}">
<unwar src="target/${maven.war.final.name}" dest="${maven.tomcat.home}/webapps/testsuite"/>
</j:if>
<j:if test="${depType=='war'}">
<copy file="target/${maven.war.final.name}"
todir="${maven.tomcat.home}/webapps"/>
</j:if>
</goal>
</project>