ant ?中使用scp 时 ,出现 ?jsch.jar包 加载出现问题?
?
bulid.xml 中定义 ?自己 ?ant 标签 ?出现一下错误:
?
写道
libin@libin-ThinkPad-T420:~/workspace/yoyo/datacell-refactor$ ant initMyTask
Buildfile: /home/libin/workspace/yoyo/datacell-refactor/build.xml
initMyTask:
BUILD FAILED
/home/libin/workspace/yoyo/datacell-refactor/build.xml:130: taskdef A class needed by class org.apache.tools.ant.taskdefs.optional.ssh.Scp cannot be found: com/jcraft/jsch/Logger
using the classloader AntClassLoader[/home/libin/workspace/yoyo/datacell-refactor/lib/jsch-0.1.50.jar]
Total time: 1 second
libin@libin-ThinkPad-T420:~/workspace/yoyo/datacell-refactor$ ant -version
Apache Ant(TM) version 1.9.0 compiled on March 5 2013
libin@libin-ThinkPad-T420:~/workspace/yoyo/datacell-refactor$
Buildfile: /home/libin/workspace/yoyo/datacell-refactor/build.xml
initMyTask:
BUILD FAILED
/home/libin/workspace/yoyo/datacell-refactor/build.xml:130: taskdef A class needed by class org.apache.tools.ant.taskdefs.optional.ssh.Scp cannot be found: com/jcraft/jsch/Logger
using the classloader AntClassLoader[/home/libin/workspace/yoyo/datacell-refactor/lib/jsch-0.1.50.jar]
Total time: 1 second
libin@libin-ThinkPad-T420:~/workspace/yoyo/datacell-refactor$ ant -version
Apache Ant(TM) version 1.9.0 compiled on March 5 2013
libin@libin-ThinkPad-T420:~/workspace/yoyo/datacell-refactor$
?
buils.xml 中 的 脚本:
写道
<path id="jsch.path">
<fileset dir="${basedir}/lib" includes="*jsch*.jar" />
</path>
<target name="initMyTask">
<taskdef name="myscp" classname="org.apache.tools.ant.taskdefs.optional.ssh.Scp" classpathref="jsch.path">
</taskdef>
</target>
<fileset dir="${basedir}/lib" includes="*jsch*.jar" />
</path>
<target name="initMyTask">
<taskdef name="myscp" classname="org.apache.tools.ant.taskdefs.optional.ssh.Scp" classpathref="jsch.path">
</taskdef>
</target>
?
?
如果使用 ?:
写道
ant initMyTask -lib /home/libin/workspace/yoyo/datacell-refactor/lib/jsch-0.1.50.jar
?
执行 是正确的??
?
有朋友 遇到这个问题吗? 在使用scp命令的时候,,出见加载 jar包 貌似不起作用的现象