Deploy myApp.war file to Tomcat application server, using Tomcat manager app and an ant script.
Make a folder "ant" in your project and this it the folder for all other actions below.
Make a folder "dist" and generate your myApp.war file into this folder with the "build.xml" script.
Make a folder "tomcat-libs" and copy following files from your tomcat installation:
- catalina-ant.jar
- catalina.jar
- servlet-api.jar
- jsp-api.jar
Create file "tomcat.properties" with properties for tomcat server and tomcat manager app.
Create "deploy.xml" file for deployment.
Execute deploy.xml script with ant, it must show the info sections with properties of your tomcat.properties file.
Execute deploy-webapp target from deploy.xml script to deploy your myApp.war file to tomcat server through the tomcat manager app.
If you are using for example Jenkins, you can set the "secprops.location" from outside the script, so you can use the same script for different tomcat installations.
myApp ant deploy file.
tomcat.manager.url=http://myAppServer:7011/manager/text tomcat.username=tomcat tomcat.password=tomcat webapp.name=myApp
myApp ant build file.