今天在运行ant脚本ftp上传到服务器上时,遇到
================================================================================
BUILD FAILED
Could not create type ftp due to java.lang.NoClassDefFoundError:org/apache/commons/net/ftp/FTPClientConfig
================================================================================
错误。
原因是少了commons-net-1.4.1.jar和jakarta-oro-2.0.8.jar
下载完该两个jar包后,在eclipse中操作步骤如下
Window -> Preferences -> Ant -> Runtime
在Classpath栏中选中Ant Home Entries然后Add External Jars...
再运行ant脚本就ok了,附上部分ant脚本代码如下
......
<target name="dist">
<ftp password="axa_dev"
server="172.17.1.92"
userid="axa_dev"
remotedir="/usr/local/bea_axa_dev/user_projects/domains/mydomain">
<fileset dir="." includes="test.txt">
</fileset>
</ftp>
......
jar包下载网站:http://www.jarbao.com
解决Ant脚本执行时出现的BUILD FAILED错误,原因在于缺少commons-net-1.4.1.jar和jakarta-oro-2.0.8.jar。通过在Eclipse中正确配置这两个依赖后,成功实现文件的FTP上传。
9069

被折叠的 条评论
为什么被折叠?



