Missing ant-jsch.jar

Filed under: Automation, — Tags: Ant, jsch, ssh — Thomas Sundberg — 2012-01-16

The distribution of Ant 1.8.2 is broken on Mac.

It turns out that just adding jsch-0.1.45.jar to /usr/share/ant/lib is not enough if you want to use sshexec to execute ssh commands on a remote host. You will still get the error:

BUILD FAILED
/Users/tsu/projects/linkon/fp/sabine/resources/deploy/build.xml:57: 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
        -/Users/tsu/.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.

This is not a bug; it is a configuration problem

The solution is to download the ant distribution and manually patch it's lib directory with ant-jsch.jar. In my case I added it to /usr/share/ant/lib

This will allow you to use ssh from Ant.

Resources



(less...)

Pages

About
Events
Why

Categories

Agile
Automation
BDD
Clean code
Continuous delivery
Continuous deployment
Continuous integration
Cucumber
Culture
Design
DevOps
Executable specification
Git
Gradle
Guice
J2EE
JUnit
Java
Javascript
Kubernetes
Linux
Load testing
Maven
Mockito
New developers
Pair programming
PicoContainer
Presentation
Programming
Public speaking
Quality
React
Recruiting
Requirements
Scala
Selenium
Software craftsmanship
Software development
Spring
TDD
Teaching
Technical debt
Test automation
Tools
Web
Windows
eXtreme Programming

Authors

Thomas Sundberg
Adrian Bolboaca

Archives

Meta

rss RSS