Hi, You don't have to redefine the sshexec task. You only need to add ant-jsch.jar and jsch-0.1.37.jar in your Ant classpath (-lib ...) as Steve said.
Cheers -- Charbel On Feb 12, 2008 10:57 AM, Steve Loughran <[EMAIL PROTECTED]> wrote: > serdsch wrote: > > Hi Peter, > > > >> No quite non-existent: > >> http://ant.apache.org/manual/OptionalTasks/sshexec.html > > > > Yeah, OK, there is this little bit of documentation from Ant which only > > tells you how to use the task from inside Ant. I wouldn't really expect > more > > from Ant, but the documentation of jcraft is really non-existent, isn't > it? > > The source is OK...I've integrated it into other things. And the author > is very helpful on email. So, given its a free java SSH client, I'm happy > :) > > I guess you're trying to run it embedded...things are a bit more complex > then as yes, you do need the right optional JAR on your classpath. > > > > > Anyway, thanx a lot for your answer, it really helped. It gave me some > > ideas, so I tried and looked around inside the .jars and found the > solution. > > I am not using a full ant distribution but only the ant-launcher and its > > necessary .jars, so I dont have a ant/lib folder. What I did now was to > add > > '-lib ${path-to-jsch-0.1.37.jar}' in the bat-file calling Ant, but it > still > > couldn't find the *.sshexec-class. This one is found in the ant-jsch.jar > > that comes with your Ant distribution. > > > > So for anyone facing the same problem, what you need is the following: > > > > 1) jsch-0.1.37.jar from jcraft > > 2) ant-jsch.jar from ant > > 3) put them both in some folder ${path-to-my-ant} where ever you like > > 4) define the task in your buildfile as the following: > > > > <taskdef name="sshexec" > > classname="org.appache.tools.ant.taskdefs.optional.ssh.SSHExec"/> > > > > 5) when calling Ant, set a command line property '-lib > ${path-to-my-ant}' > > > > And everything works just fine... > > > > Cheers, Sergio > > > -- > Steve Loughran http://www.1060.org/blogxter/publish/5 > Author: Ant in Action http://antbook.org/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
