从 ant build.xml 中的本地 lib 目录加载 JSCH 库 [英] Loading JSCH Library from local lib directory in ant build.xml
问题描述
我可以在将 jsch-0.1.44.jar 添加到 ant/lib 目录时执行 SCP 任务.但是我想从本地 lib 目录加载并将其添加到类路径中.请您帮忙
I can do SCP task while i add jsch-0.1.44.jar to ant/lib directory.But i want to load from the local lib dir and add it to classpath.Could you please help
推荐答案
内置任务用于自定义类路径的选项有限.
The built-in tasks have limited options for customizing the classpath.
1) 将您的自定义 jar 放在 ${user.home}/.ant/lib 目录中
1) Place your custom jars in the ${user.home}/.ant/lib directory
/home/mark/.ant
└── lib
├── ivy.jar
└── jsch.jar
这是我安装 jar 的地方,这些 jar 是我对标准 ANT 发行版的个人扩展
This is where I install jars that are my personal extensions to the standard ANT distro
2) 在命令行中提供 jar 目录的位置
2) Supply the location of the jar directory on the commandline
ant -lib /path/to/jsh/jar
3)您可以尝试按照此处的建议声明一个新任务:
3) You could try to declare a new task as recommended here:
这篇关于从 ant build.xml 中的本地 lib 目录加载 JSCH 库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!