I have somewhat common problem with ant not being able to find the class org.apache.tools.ant.taskdefs.optional.ssh.SSHExec. However, the common solutions don't work for me:
- ensuring that the jsch.jar and ant-jsch.jar exists in the classpath
- ensuring that there are not multiple different versions of the mentioned jars
- ensuring that ant -diagnostics is infact seeing the jars
I have no idea what I should try out next. The output I get is the good 'ol:
build.xml: Problem: failed to create task or type sshexec
Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.SSHExec was not found.
This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
-/usr/share/ant/lib
-/opt/home/myname/.ant/lib
-a directory added on the command line with the -lib argument
Do not panic, this is a common problem.
The commonest cause is a missing JAR.
My setup:
- ant version: Apache Ant(TM) version 1.9.2 compiled on January 22 2014
- ant-jsch version: 1.9.2
- jsch version: 0.1.52
Ant diagnostics log can be found here: http://pastebin.com/q5AURxuk
As seen from the diagnostics log, the jars are there but ant reports: sshexec : Not Available (the implementation class is not present)
I also extracted the jar file and ensured that the class is there.
Any ideas?