Question

I'm an ant newbie and I'm trying to run an ant build from Cruise Control that utilizes the SCP and SSHEXEC tasks. When I try to run the script I get this error:

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 -/app/cruisecontrol-bin-2.8.4/lib

I ran ant -diagnostics and it says ant-jsch.jar (40200 bytes) is included in my ANT_HOME/lib, and I see the jar in cruisecontrol-bin-2.8.4/lib as well, though this one is ~30,122 bytes.

However, the diagnostic says:

sshexec : Missing dependency com.jcraft.jsch.Logger
scp : Missing dependency com.jcraft.jsch.Logger

I dropped the version from ANT_HOME/lib into the cruise control lib and it didn't make a difference (I'm not sure if I have to reload the class path or something, or even how to do that).

Any advice or suggestions would be greatly appreciated, I really have no idea how to remedy this. I was trying taskdefs last night as well but that wasn't working either.

Was it helpful?

Solution

You made a step in the right direction by ensuring you have the Ant-side of this in place. The problem is that you're missing the external JSch class com.jcraft.jsch.Logger.

To fix this problem you need to satisfy the external dependency (as listed in the Ant docs) by downloading and installing jsch.jar from JCraft. You can put the jar in your Ant lib directory if that suits.

When you get 'dangling' external dependencies that you don't recognise, googling is often the quickest way to find the source: in this case JCraft shows up about fourth in the search at the moment. JarFinder is third, and it maps the class name to the jar that contains it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top