在eclipse中使用Ant打war包,报了如下错:
[taskdef] Could not load definitions from resource net/sf/antcontrib/antlib.xml. It could not be found.
经过研究发现是,在Eclipse中自带的Ant环境下缺少一个jar包,该jar包中包含net/sf/antcontrib/antlib.xml,为ant-contrib-1.0b3.jar(我选用的ant是1.70的),eclipse版本是3.4.2,eclipse中自带的ant也是1.70,但是不包含ant-contrib-1.0b3.jar,因此只要下载ant,然后将其中的ant-contrib-1.0b3.jar引入到eclipse的ant中即可。方法如下:
到http://ant.apache.org上寻找自己所要的Ant版本,我的是1.70,下载,解压,到目录ant/lib下找到ant-contrib*.jar(注:ant-contrib*.jar 是对ant的补充jar包,所以其实可以直接单独去下载http://sourceforge.net/projects/ant-contrib,前几天(也就是2013-07-10左右)