To check if specific version of Apache Ant is available in brew we can run search command: brew search ant You can open the link and find the Download section, copy a link to the latest version available (for April 2019 it’s 0.1.55) and download JAR file to Ant proposed location (line #7 in notification output): wget -O jsch-0.1.55.jar -P=/usr/local/Cellar/ant/1.10.5/libexec/lib/ 2. To add JSCh library to Ant, we need to download it from library official site. This task has been tested with JSCh 0.1.29 and above and won’t work with versions of JSCh earlier than 0.1.28. See Library Dependencies for more information. Note: This task depends on external libraries not included in the Ant distribution. If we check sshexec task official page, then we can found a note with some details.
#Apache ant 1.8 2 how to
So how to fix this? Actually it’s very easy. This is not a bug it is a configuration problem a directory added on the command line with the -lib argument You need the JAR files that the optional tasks depend upon.Īnt's optional task dependencies are listed in the manual.Īction: Determine what extra JAR files are needed, and place them in one of: It is not enough to have Ant's optional JARs Users/username/deploy-prod.xml:15: Problem: failed to create task or type sshexecĬause: Could not load a dependent class com/jcraft/jsch/Logger You will see the output like this: BUILD FAILED We can make a very simple task in a build.xml to create a folder in some location (IP address and all credentials used just for demonstration purposes, replace them if you want to execute it): Ant has a special task for that: sshexec.
Sometimes we need to execute some commands on the remote host (for example AWS EC2 instance) with ssh.
#Apache ant 1.8 2 install
Install A nt library dependencies (sshexec) If you ok with current version (line #1 stable 1.10.5) you can execute install command: brew install ant You will see the output with formula details like this: ant: stable 1.10.5, HEAD Before install we can check what the latest version available in brew: brew info ant