PR: 19237 Based on a submission by: Rob Meyer <rob at bigdis dot com> git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275151 13f79535-47bb-0310-9956-ffa450edef68master
@@ -19,7 +19,8 @@ remote machine.</p> | |||||
<p><b>Note:</b> This task depends on external libraries not included | <p><b>Note:</b> This task depends on external libraries not included | ||||
in the Ant distribution. See <a | in the Ant distribution. See <a | ||||
href="../install.html#librarydependencies">Library Dependencies</a> | href="../install.html#librarydependencies">Library Dependencies</a> | ||||
for more information. This task has been tested with jsch-0.1.2 and jsch-0.1.3.</p> | |||||
for more information. This task has been tested with jsch-0.1.2 to | |||||
jsch-0.1.7.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table border="1" cellpadding="2" cellspacing="0"> | <table border="1" cellpadding="2" cellspacing="0"> | ||||
@@ -18,7 +18,8 @@ | |||||
<p><b>Note:</b> This task depends on external libraries not included | <p><b>Note:</b> This task depends on external libraries not included | ||||
in the Ant distribution. See <a | in the Ant distribution. See <a | ||||
href="../install.html#librarydependencies">Library Dependencies</a> | href="../install.html#librarydependencies">Library Dependencies</a> | ||||
for more information. This task has been tested with jsch-0.1.3.</p> | |||||
for more information. This task has been tested with jsch-0.1.7 and | |||||
won't work with earlier versions of jsch..</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table border="1" cellpadding="2" cellspacing="0"> | <table border="1" cellpadding="2" cellspacing="0"> | ||||
@@ -214,8 +214,22 @@ public class SSHExec extends SSHBase { | |||||
if (outputFile != null) { | if (outputFile != null) { | ||||
writeToFile(out.toString(), append, outputFile); | writeToFile(out.toString(), append, outputFile); | ||||
} | } | ||||
// this is the wrong test if the remote OS is OpenVMS, | |||||
// but there doesn't seem to be a way to detect it. | |||||
int ec = channel.getExitStatus(); | |||||
if (ec != 0) { | |||||
String msg = "Remote command failed with exit status " + ec; | |||||
if (getFailonerror()) { | |||||
throw new BuildException(msg); | |||||
} else { | |||||
log(msg, Project.MSG_ERR); | |||||
} | |||||
} | |||||
} | } | ||||
} catch (BuildException e) { | |||||
throw e; | |||||
} catch (Exception e) { | } catch (Exception e) { | ||||
if (getFailonerror()) { | if (getFailonerror()) { | ||||
throw new BuildException(e); | throw new BuildException(e); | ||||