目的是:
1: connect to a remote server maybe via host: ip , port: 8181
2: stop Tomcat that's running on that server
3: deploy a .war file
4: restart tomcat
1: connect to a remote server maybe via host: ip , port: 8181
2: stop Tomcat that's running on that server
3: deploy a .war file
4: restart tomcat
我相信Tomcat文档下的监测和管理Tomcat完全提供了关于如何停止给定应用程序的一些信息,但不是服务器:
<jmx:invoke
name="Catalina:type=Manager,path=/servlets-examples,host=localhost"
operation="stop"/>
如果你有服务器的SSH访问,那么你可能要考虑的JSch库 ,你可以结合使用与SSHExec Ant任务来启动和停止服务器:
<sshexec host="somehost"
username="dude"
password="yo"
command="/etc/init.d/tomcat restart"/>