Cause: Could not load a dependent class com/jcraft/jsch/Logger

本文详细解析了在使用Ant进行项目部署过程中遇到的scp任务失败问题,原因是未能加载依赖类com/jcraft/jsch/Logger。文章提供了从Maven中央库获取jsch库并将其放置在Ant安装包lib目录下的解决方案,确保了部署流程的顺利进行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值