eclipse导入spring源码
来源:互联网 发布:逆战冰神鼠标宏数据 编辑:程序博客网 时间:2024/06/13 04:14
环境:jdk1.8 + eclipse Oxygen(4.7.0)
1、下载安装git for windows,地址:http://pan.baidu.com/s/1slluIXR
2、下载spring-framework源码(目前版本5.0.0.RC5),在你的目标目录鼠标右键,点击Git Bash Here,然后git clone https://github.com/spring-projects/spring-framework.git
3、下载安装配置gradle构建工具,地址:https://services.gradle.org/distributions/gradle-4.1-bin.zip
4、eclipse安装gradle插件:Help->Eclipse Marketplace...->在Find输入buildship查找,然后点击install。如图
5、eclipse安装groovy插件,地址:https://github.com/groovy/groovy-eclipse/wiki。我的eclipse是Oxygen(4.7)所以选http://dist.springsource.org/snapshot/GRECLIPSE/e4.7/
eclipse界面点击Help->Install New Software...->Add...
6、导入spring源码,eclipse界面:File->Import...->Existing Gradle Project->选择刚才git下载好的spring源码目录->Finish
7、用gradle构建spring。首先调出gradle面板:eclipse界面Window->Show View->Other...->选择gradle->Open
然后在Gradle Tasks界面,展开并点击spring->build->build,静等构建失败(这一步的目的是把cglib、objenesis重新打包,见spring-core中的spring-core.gradle文件)。
8、解决spring-context和spring-web中找不到com.sun.net.httpserver.*的问题。eclipse界面,右键点击spring-context->Build Path->Configure Build Path...
对spring-web做同样操作。
9、解决eclipse不认识Aspects的*.aj文件的问题,给eclipse安装AJDT插件,地址:http://www.eclipse.org/ajdt/downloads/,目前最新的eclipse 4.6版本的,但是亲测4.7页能用:http://download.eclipse.org/tools/ajdt/46/dev/update。
安装方法和第5步一毛一样。
10、导入完成
11、再次点击spring->build->build构建,依然失败:Failed to capture snapshot of input files for task 'distZip' property……
解决方法:修改spring/gradle/docs.gradle文件,把schemaZip任务替换成如下:
task schemaZip(type: Zip) {group = "Distribution"baseName = "spring-framework"classifier = "schema"description = "Builds -${classifier} archive containing all " +"XSDs for deployment at http://springframework.org/schema."duplicatesStrategy 'exclude'moduleProjects.each { subproject ->def Properties schemas = new Properties();subproject.sourceSets.main.resources.find {it.path.endsWith("META-INF\\spring.schemas")}?.withInputStream { schemas.load(it) }for (def key : schemas.keySet()) {def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')assert shortName != keyFile xsdFile = subproject.sourceSets.main.resources.find {it.path.endsWith(schemas.get(key).replaceAll('\\/','\\\\'))}assert xsdFile != nullinto (shortName) {from xsdFile.path}}}}再次构建,完成!
补充:如果重新编译项目spring-aspects项目报错:“pointcut cannot be resolved to a type”、“declare cannot be resolved to a type”等,打开.project,调换
<buildCommand> <name>org.eclipse.ajdt.core.ajbuilder</name> <arguments> </arguments></buildCommand><buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments></buildCommand>这两个buildCommand的位置,把org.eclipse.ajdt.core.ajbuilder放后面,如图
- Spring源码导入Eclipse
- spring源码导入eclipse
- eclipse导入spring源码
- eclipse导入spring源码
- eclipse 导入 spring 源码
- spring源码导入eclipse
- eclipse导入spring源码
- eclipse导入spring源码
- Spring 源码导入Eclipse
- spring源码导入eclipse
- spring framework源码导入eclipse
- 将Spring源码导入Eclipse
- Eclipse中导入spring源码
- Spring 源码导入到 Eclipse
- spring framework源码导入eclipse
- spring源码导入到eclipse
- spring源码导入eclipse全过程
- 导入spring源码到eclipse
- 2017.9.15 垂直居中的方法
- Number_of_Longest_Increasing_Subsequence
- 构建自己的centos+jdk7+tomcat8的docker镜像
- js中Function类型
- 第一次用
- eclipse导入spring源码
- 阿里云的CentOS系统配置java web环境
- 本地服务器Tomcat安装及简单使用教程
- sql 临时表和表变量
- Kruskal算法模板
- SEQUENCE
- PHP合并两张图片的实现
- Python之函数
- mfc中UpdateData的用法