ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
Subject Multiple <sshexec> invocations
Date Thu, 11 Aug 2005 21:26:42 GMT
First time <sshexec> user, so please be gentle ;-)
I'm using Ant 1.6.2 with Jsch 0.1.21.

I'm a bit baffled by the results I get using <sshexec>.
The session below shows all relevant information.

If I run just one target, doing one <sshexec>,
it works fine, i.e. I get the echo to execute correctly.

If I run twice the same target (build linux linux),
the first <sshexec> works, but the second fails with
an "Auth cancel" exception.

If OTOH the two <sshexec> belong to the same project,
i.e. are executed as dependencies of a single target
(build linux-solaris), then the first one works, but
the second one this time doesn't fail, but doesn't
provide any output at all.

All invocations are below, and show what I mean.

Anybody has any insight? Thanks, --DD

P:\com_lgc\cycle11\infrasdk>dir /B lib
jsch-0.1.21.jar

P:\com_lgc\cycle11\infrasdk>type build.bat
@..\ant\bin\ant -emacs -lib lib\jsch-0.1.21.jar %*

P:\com_lgc\cycle11\infrasdk>type build.xml
<?xml version="1.0"?>
<project name="sshexec">
  <property file="build.properties" />

  <!-- ==================================================== -->
  <target name="linux">
    <sshexec host="${linux.server}" trust="true" timeout="${10sec}"
             username="${username}" password="${password}"
             command="echo Hello from ${linux.server}" />
  </target>

  <!-- ==================================================== -->
  <target name="solaris">
    <sshexec host="${solaris.server}" trust="true" timeout="${10sec}"
             username="${username}" password="${password}"
             command="echo Hello from ${solaris.server}" />
  </target>

  <!-- ==================================================== -->
  <target name="linux-solaris" depends="linux, solaris" />
  <target name="solaris-linux" depends="solaris, linux" />
</project>

P:\com_lgc\cycle11\infrasdk>build linux
Buildfile: build.xml

linux:        [infrasdk]
Connecting to bar.lgc.com:22
Hello from bar.lgc.com


BUILD SUCCESSFUL
Total time: 2 seconds
P:\com_lgc\cycle11\infrasdk>build solaris
Buildfile: build.xml

solaris:      [infrasdk]
Connecting to foo.lgc.com:22
core file size (blocks)     0
...
Hello from foo.lgc.com


BUILD SUCCESSFUL
Total time: 2 seconds
P:\com_lgc\cycle11\infrasdk>build linux linux
Buildfile: build.xml

linux:        [infrasdk]
Connecting to bar.lgc.com:22
Hello from bar.lgc.com


linux:        [infrasdk]
Connecting to bar.lgc.com:22

BUILD FAILED
P:\com_lgc\cycle11\infrasdk\build.xml:22: com.jcraft.jsch.JSchException:
Auth cancel

Total time: 2 seconds
P:\com_lgc\cycle11\infrasdk>
P:\com_lgc\cycle11\infrasdk>
P:\com_lgc\cycle11\infrasdk>build solaris solaris
Buildfile: build.xml

solaris:      [infrasdk]
Connecting to foo.lgc.com:22
core file size (blocks)     0
...
Hello from foo.lgc.com


solaris:      [infrasdk]
Connecting to foo.lgc.com:22

BUILD FAILED
P:\com_lgc\cycle11\infrasdk\build.xml:29: com.jcraft.jsch.JSchException:
Auth cancel

Total time: 2 seconds
P:\com_lgc\cycle11\infrasdk>
P:\com_lgc\cycle11\infrasdk>
P:\com_lgc\cycle11\infrasdk>build linux-solaris
Buildfile: build.xml

linux:        [infrasdk]
Connecting to bar.lgc.com:22
Hello from bar.lgc.com


solaris:      [infrasdk]
Connecting to foo.lgc.com:22

BUILD SUCCESSFUL
Total time: 3 seconds
P:\com_lgc\cycle11\infrasdk>build solaris-linux
Buildfile: build.xml

solaris:      [infrasdk]
Connecting to foo.lgc.com:22
core file size (blocks)     0
...
Hello from foo.lgc.com


linux:        [infrasdk]
Connecting to bar.lgc.com:22

BUILD SUCCESSFUL
Total time: 3 seconds
P:\com_lgc\cycle11\infrasdk>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message