Using Maven to run a remote command

不想你离开。 提交于 2019-12-11 01:34:40

问题


What is the best way to have Maven execute a command on a remote server?

Before I use a wagon to move my newly created jar to our development environment, I want to shut down a service that depends on it.

The best I can come up with so far is to use the exec-maven-plugin to execute the remote command via ssh. Is there are better/more preferred way to do this?


回答1:


AFAIK, Maven doesn't provide any particular support to execute ssh commands. So either use the Maven exec plugin or the Maven AntRun Plugin and the SSHEXEC Ant task if portability is a concern.




回答2:


You could use sshexec-maven-plugin.

More info:

  • wiki
  • source


来源:https://stackoverflow.com/questions/4051986/using-maven-to-run-a-remote-command

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