ANT 找不到特定的库 [英] ANT can't find specific libraries
问题描述
我正在尝试使用 SSHEXEC ANT 任务,它需要 JSCH 库.
I am trying to use the SSHEXEC ANT task, which requires the JSCH library.
当我尝试使用 SSHEXEC
任务时,我得到以下信息:
When I try to use an SSHEXEC
task, I get the following:
BUILD FAILED
/home/www/test/build/build.xml:140: Problem: failed to create task or type sshexec
Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.SSHExec 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
-/root/.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
我已经把jsch-0.1.50.jar
(最新的)放在/usr/share/ant/lib
,/root/.ant/lib
甚至尝试了以下操作:
I have placed jsch-0.1.50.jar
(the latest) in /usr/share/ant/lib
, /root/.ant/lib
and even tried the following:
ant my-sshexec-target-name -lib /path/to/jsch-0.1.50.jar
而且我不断收到同样的错误.我还尝试在所有相同位置将文件重命名为 jsch.jar
.结果一样.我在这里做错了什么?
And I keep getting the same error. I have also tried renaming the file to simply jsch.jar
in all the same locations. Same result. What am I doing wrong here?
更新
我还运行了 ant -diagnostics
并看到了这个:
Also I ran ant -diagnostics
and see this:
...
-------------------------------------------
Tasks availability
-------------------------------------------
p4reopen : Not Available (the implementation class is not present)
image : Not Available (the implementation class is not present)
sshexec : Not Available (the implementation class is not present)
wlrun : Not Available (the implementation class is not present)
p4label : Not Available (the implementation class is not present)
p4revert : Not Available (the implementation class is not present)
p4submit : Not Available (the implementation class is not present)
scp : Not Available (the implementation class is not present)
p4change : Not Available (the implementation class is not present)
p4delete : Not Available (the implementation class is not present)
p4integrate : Not Available (the implementation class is not present)
rexec : Not Available (the implementation class is not present)
stlist : Not Available (the implementation class is not present)
telnet : Not Available (the implementation class is not present)
etc...
注意:sshexec:不可用(不存在实现类)
这是什么意思?
推荐答案
将 ANT_HOME 设置为/usr/share/ant/
Set ANT_HOME to /usr/share/ant/
export ANT_HOME=/usr/share/ant/
这篇关于ANT 找不到特定的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!