我在groovy中编写我的第一个自动化脚本,并且遇到了障碍。 同时利用该AntBuilder类的运行sshexec()我遇到了以下错误:我可以避免使用Grape在Groovy中加载模块吗?
: 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
-ANT_HOME\lib
-the IDE Ant configuration dialogs
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
到目前为止,我已经找到了这个最好的解决方案是使用
Grape.grab(group : "com.jcraft", module : "jsch", classLoader : this.class.classLoader.rootLoader)
Grape.grab(group:"ant", module:"ant-jsch", classLoader:this.class.classLoader.rootLoader)
为了加载所需的模块。 但是,我想消除Grape从远程Maven存储库下载jar的滞后时间。
有没有办法下载和保存模块以供将来使用,可能是在JAVA_PATH中,或者出现这种情况?
的文物应user.home_dir/.m2目录/库缓存......本计划不运行的速度更快第二次呢? – sjr
不幸的是,它在后续运行中运行速度很慢。似乎没有缓存,我的用户下也没有.m2目录。 Win机器上的路径是不同的? – Ryan
回购仍在您的Windows主目录下。所有你需要的是你的类路径上的正确的罐子,他们如何到达那里并不重要。 –