Tuesday, July 19, 2011

Using Tomcat 6 Ant DeployTask

It has been a while since I've setup the Tomcat Ant tasks and thought I'd capture what it took for me to get it working.  I found some great references that made this easy:
The references were using older versions of Tomcat, so there were a few changes in the classpath I had to make.  I also had an issue with a forward slash located in the war attribute in the deploy task example I pulled from Matt Raible's site.

Here is what is working for me:
<path id="tomcat.classpath">
    <pathelement location="${tomcat.home}/bin/tomcat-juli.jar"/>
    <pathelement location="${tomcat.home}/lib/catalina-ant.jar"/>
    <pathelement location="${tomcat.home}/lib/jasper.jar"/>
    <pathelement location="${tomcat.home}/lib/servlet-api.jar"/>
<taskdef resourcce="org/apache/catalina/ant/catalina.tasks"

<target name="deploy" depends="make-war" if="tomcat.home"
        description="deploy Tomcat to the remote server">
    <deploy url="${manager.url}"

1 comment: