failed to create task or type scp
Da will man nichtsahnend seine build.xml ausführen und dann so etwas… scp, um das ganze auf seinen Apache Tomcat zu schieben, verweigert seinen Dienst und man erhält so eine Fehlermeldung:
C:\eclipse\workspaces\…\build.xml:
Problem: failed to create task or type scpCause: Could not load a dependent class com/jcraft/jsch/UserInfo
It is not enough to have Ant’s optional JARs
you need the JAR files that the optional tasks depend upon.
Ant’s optional task dependencies are listed in the manual.Action: Determine what extra JAR files are needed, and place them in one of:
-C:\eclipse\installs\3.3\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib
-C:\Documents and Settings\vdb\.ant\lib
-a directory added on the command line with the -lib argumentDo not panic, this is a common problem.
The commonest cause is a missing JAR.This is not a bug; it is a configuration problem
Am besten gefällt mir daran das “Do not Panic…”. ;-) Und in der Tat ist das Problem schnell behoben. Man braucht nur die entsprechende jsch.jar (aktuell jsch-0.1.42.jar) für ant, welche man auf JCraft bekommt. Diese dann in das, in der Fehlermeldung angegebene lib-Verzeichnis kopiert und schon sollte alles funktionieren.
Und wenn nicht, dann stellt sich Eclipse nur ein bisschen doof an. Dann muss man die .jar noch zusätzlich im Eclipse unter -> Window -> Preferences -> Ant -> Runtime -> Classpath -> Ant Home Entries (Default) mittels -> Add External JARs… hinzufügen. Und schon klappt alles. :)













