You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Dominique Devienne <dd...@gmail.com> on 2005/08/11 23:26:42 UTC

Multiple invocations

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


Re: Multiple invocations

Posted by Robert Koberg <ro...@koberg.com>.
Dominique Devienne wrote:
> Note that I tried Ant 1.6.5 and 1.7 (CVS HEAD), with the same Jsch and
> they all behave the same way. Maybe I need to try an older version of
> Jsch... --DD

no - it has been like this for a while (at least a couple of years). 
*Please* someone tell me I am wrong. (and how to do it right...)

I have gone to opening FTP access for select IP addresses under my control.

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


Re: Multiple invocations

Posted by Dominique Devienne <dd...@gmail.com>.
Note that I tried Ant 1.6.5 and 1.7 (CVS HEAD), with the same Jsch and
they all behave the same way. Maybe I need to try an older version of
Jsch... --DD

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