I got the error
Turns out that the default deployment of Ant (1.7) did not contain this jar on Mac OS-x 10.5. So I had to do two thingsBUILD FAILED
Deploy.ant.xml:57: Problem: failed to create task or type scp
Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.Scp 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/alvinrichards/.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
- Download the binary distribution of Ant 1.7, unpack the jar and copy ant-jsch.jar to /usr/share/ant/lib
- Download the implementation of the SSH java code from JCraft and copy it to /usr/share/ant/lib
2. I still can't SCP to EC2
So I know I can scp -i to this EC2 host, but the following Ant task fails
<scp localfile="dba.war"
todir="root@xxxx:/usr/java/apache-tomcat-6.0.14/webapps/"
keyfile="xxxx-Amazon-LAMP-image-keypair">
with
BUILD FAILED
/Volumes/Develop/Develop/Projects/HarpoonDeployMK9a/Deploy.ant.xml:57: neither password nor passphrase for user root has been given. Can't authenticate.
Turns out that you need the following in the SCP task for it to work with EC2
trust="yes"
passphrase="xxx"
2 comments:
ahhhhaaaaaaaaaaa!!!!
man thank you! i was pulling my hair out over this too. very irritating that mac osx ships without ant-jsch.jar. i grabbed it from the binary as you did and my scp instantly worked (after placing jsch.jar in ANT_HOME/lib of course).
post much appreciated!
colin
Adding passphrase="" to your scp task works as well so you don't have to hard code your account password in there. Probably should fix that in ant scp. :-)
Post a Comment