使用Maven运行远程命令 [英] Using Maven to run a remote command

查看:115
本文介绍了使用Maven运行远程命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让Maven在远程服务器上执行命令的最佳方法是什么?

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

在我用旅行车将新创建的jar移到我们的开发环境之前,我想关闭一个依赖它的服务.

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.

到目前为止,我能想到的最好的方法是使用exec-maven-plugin通过ssh执行远程命令.有没有更好/更喜欢的方式来做到这一点?

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?

推荐答案

AFAIK,Maven不提供执行ssh命令的任何特定支持.因此,可以使用 Maven exec插件

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.

这篇关于使用Maven运行远程命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆