Skip to content

Commit

Permalink
sshexec fails on windows - Closes #22 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
tchemit authored Apr 12, 2018
1 parent 103acbc commit 06a66d9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/java/org/codehaus/mojo/wagon/SshExecMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.wagon.CommandExecutor;
import org.apache.maven.wagon.Streams;
import org.apache.maven.wagon.Wagon;
import org.apache.maven.wagon.WagonException;
import org.apache.maven.wagon.providers.ssh.jsch.AbstractJschWagon;
import org.apache.maven.wagon.providers.ssh.jsch.ScpWagon;

/**
Expand Down Expand Up @@ -63,7 +65,14 @@ protected void execute( final Wagon wagon )
{
try
{
Streams stream = ( (ScpWagon) wagon ).executeCommand( command, true, false );
Streams stream;
if ( wagon instanceof AbstractJschWagon )
{
stream = ( (AbstractJschWagon) wagon ).executeCommand( command, true, false );
} else
{
stream = ( (CommandExecutor) wagon ).executeCommand( command, false );
}
this.getLog().info( "sshexec: " + command + " ..." );
if ( displayCommandOutputs )
{
Expand Down

1 comment on commit 06a66d9

@barrymw
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchemit, thanks for the heads up and the fix.

Please sign in to comment.