Cause: Could not load a dependent class com/jcraft/jsch/Logger
原因ant scp 依赖jsch-xxx.jar
解决: 到maven 中央库中,找一个jar 放到ant 的安装包lib 目录下。
http://repo.maven.apache.org/maven2/com/jcraft/jsch/
找一个比较新的jar 即可。
[devops@iZbp12vtv76y9q3d633bh6Z nginx-analysis]$ ./ant/bin/ant -f shell/scp-niginx-log.xml -Ddate=2018-11-28
Buildfile: /resource/nginx-analysis/shell/scp-niginx-log.xml
scp-tar:
BUILD FAILED
/resource/nginx-analysis/shell/scp-niginx-log.xml:17: Problem: failed to create task or type scp
Cause: Could not load a dependent class com/jcraft/jsch/Logger
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:
-/resource/nginx-analysis/ant/lib
-/home/devops/.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