start/stop tomcat using maven

浪子不回头ぞ 提交于 2019-12-05 10:14:15

You can try to use the maven tomcat plugin or if it does not give you everything you need, you can always use an ant task here is a reference on the task

Indeed, You can NOT start and stop Tomcat running remotely using Cargo, only deploy and undeploy your web application.

Actually, to my knowledge, there is currently nothing allowing to do this out of the box.

As explained here, the only way to make server "A" start or stop a service like Tomcat when the request comes from client "B" is that yet-another service needs to be available and already running on server "A". [...] and I don't know if such a service is available.

In this message, someone is describing such a solution (based on a socket listener) that you could maybe use (by doing some telnet through maven) but the message is quite old so it's likely outdated and the link pointing to the code seems to be dead. I didn't check out the whole thread, maybe there are other ideas.

If you are using windows, remote service sharing is another possible solution as described here. But, again, this would require some work on your side.

From a security standpoint, it's only possible in this way...

Linux: use an SCP or script via SSH Client (putty), then '$CATALINA_HOME/bin/shutdown.sh'

Windows: use sc command, like "sc \192.168.10.10 stop tomcat6"

Quick and clean!

You can use Cargo Daemon web-application. It runs on the remote machine and can start/stop tomcat for you (as well as deploy an app). You just need to configure Cargo plugin and call mvn:daemon-start. Here is the link: http://cargo.codehaus.org/Cargo+Daemon. It's easier to start with provided Cargo Daemon archetype: http://cargo.codehaus.org/Maven2+Archetypes#Maven2Archetypes-daemon

Try this useful Plugin

Afterwards try this:

mvn tomcat:start

and

mvn tomcat:stop
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!