Eclipse中编译ant源代码
1. 下载ant源代码 (git clone https://github.com/apache/ant.git)
2. 用eclipse导入
- file->import->project from git
- 配置local git repository
- import as exist project—>ant project->select the build.xml
这样之后,在eclipse就会出现apache-ant项目,但是有几个错误,那是因为没有导入ant的依赖库
3. 下载依赖库
- 检查是否已经安装了ant
- 目录切换到ant源代码的根目录
- 执行ant -f fetch.xml -Ddest=system (下载到ant源代码目录的lib目录下)
- 复制ant/lib下*.jar,到一个非源码目录
- 配置为用户库 (eclipse->window->preferences->user library->new->add jar)
4. 将新建的用户库导入到apache-ant项目中,refresh。