Raible's Wiki
Raible Designs AppFuseHomepage- Korean - Chinese - Italian - Japanese QuickStart Guide User Guide Tutorials Other ApplicationsStruts ResumeSecurity Example Struts Menu
Set your name in
UserPreferences
Referenced by
JSPWiki v2.2.33
Hide Menu |
This is version 18.
It is not the current version, and thus it cannot be edited. I finally figured out how to use Tomcat's Ant Tasks (install, remove, reload, start, stop, list) in AppFuse to ease deployment of the app. Below is a list of the steps I used to integrate them into my build.xml file. 1. Rather than defining each task with a <taskdef>, I created a tomcatTasks.properties file with the following contents: deploy=org.apache.catalina.ant.DeployTask install=org.apache.catalina.ant.InstallTask list=org.apache.catalina.ant.ListTask reload=org.apache.catalina.ant.ReloadTask remove=org.apache.catalina.ant.RemoveTask resources=org.apache.catalina.ant.ResourcesTask roles=org.apache.catalina.ant.RolesTask start=org.apache.catalina.ant.StartTask stop=org.apache.catalina.ant.StopTask undeploy=org.apache.catalina.ant.UndeployTask 2. Then I created a tomcat.properties file with the following contents. Make sure the $CATALINA_HOME/conf/tomcat-users.xml file has an entry with username/password admin/admin and that they have the manager role. # Properties for Tomcat Server tomcat.server=localhost tomcat.manager.url=http://${tomcat.server}:8080/manager tomcat.username=admin tomcat.password=admin 3. I included a reference to tomcat.properties in my build.xml file: <property file="tomcat.properties"/> 4. Then I added all a single taskdef and all the targets/tasks I wanted to use to my build.xml file: <taskdef file="${ant-contrib.dir}/tomcatTasks.properties"> <classpath> <pathelement path="${tomcat.home}/server/lib/catalina-ant.jar"/> </classpath> </taskdef> <target name="install" description="Install application in Tomcat" depends="package-web"> <deploy url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${webapp.name}" war="file:${webapp.dist}/${webapp.war}"/> </target> <target name="remove" description="Remove application in Tomcat"> <undeploy url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${webapp.name}"/> </target> <target name="reload" description="Reload application in Tomcat"> <reload url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${webapp.name}"/> </target> <target name="start" description="Start Tomcat application"> <start url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${webapp.name}"/> </target> <target name="stop" description="Stop Tomcat application"> <stop url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${webapp.name}"/> </target> <target name="list" description="List Tomcat applications"> <list url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}"/> </target> NOTE: There are a few things I discovered in this process:
The good news is that all of the issues that occur in Tomcat 4.1.x are gone in Tomcat 5.
Attachments:
|