- Open
Window -> Preferences
- Select
Ant -> Runtime
on the left side - In the classpath tab, select
Ant Home Entries
- Click on the
Add External JARs...
button - Navigate to your eclipse installation, then select
eclipse/plugins/ org.eclipse.team.cvs.ssh2_3.1.0/jsch-0.1.18.jar
- Click
okay
to confirm the file selection - Click
okay
to close the preferences dialog - Run your buildfile with
sshexec
and/orscp
tasks.
It's that easy. The specific version number of the cvs/ssh plugin and the jsch jar may differ, but it should still work.
nice one.
ReplyDeleteIf you keep getting the error about authentication, you have to turn on PasswordAuthentication in the ssh server config file.
I followed the instructions for Eclipse, Ant, and sshexec.
ReplyDeleteThe name of the jar that I found in my Eclipse plugins was identical to the one in your instructions. I am running Eclipse 3.1 on a RHEL4 Linux box. I do not use cvs.
When I attempt to run sshexec from an Eclipse project with the following build.xml target:
I invariably get this error:
com.jcraft.jsch.JSchException: java.lang.ArrayIndexOutOfBoundsException: 1024
This also occurs if I use an explicit password rather than
a keyfile.
What am I missing?
I've seen this error with ant before, it's confusing, but it comes from having a semantically invalid scp target in the build.xml
ReplyDeleteIn my case, I was using *both* the remoteToDir and remoteToFile in an attempt to rename a file at the destination. Turns out that the remoteToFile can contain the remoteToDir as a prefix. If you have both present, then what should simply be noticed as an illogical combination of attributes is instead turned into an obscure error.
Double, and triple check that you have a well formed scp task. However, the documentation for scp does *not* make it clear what valid combinations there are.