How do you deploy a Java web app to Tomcat server, on another computer on network(or internet) , through an IDE like Netbeans for development/testing & production purposes ?
Any feature in Netbeans that makes this simpler ?
You can do this by modifying your build.xml. You'll need catalina-ant.jar from the Tomcat distribution. I throw it in my build-jars directory - you can also place it in ANT_HOME/lib. Here's what I have in my build.xml to deploy to a remote Tomcat:
<property name="build-jars" location="build-jars" />
<property name="deploy" location="deploy" />
<property name="target.name" value="myapp" />
<property name="tomcat.manager.url" value="http://server.com:8080/manager/text"/>
<property name="tomcat.manager.username" value="user" />
<property name="tomcat.manager.password" value="pass" />
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask">
<classpath>
<path location="${build-jars}"/catalina-ant.jar" />
</classpath>
</taskdef>
<target name="deploy-war" depends="war" description="Deploy to Tomcat">
<deploy url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="/${target.name}"
update="true"
war="file:${deploy}/${target.name}.war" />
</target>
Note that in Tomcat 7 the user will need to have the manager-script role set in tomcat-users.xml.