Drew
Drew

Reputation: 21

Using Maven to run a remote command

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?

Upvotes: 2

Views: 5652

Answers (2)

alexfdz
alexfdz

Reputation: 435

You could use sshexec-maven-plugin.

More info:

Upvotes: 0

Pascal Thivent
Pascal Thivent

Reputation: 570335

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.

Upvotes: 3

Related Questions