Spring 源码导入到 Eclipse

来源:互联网 发布:电脑好多软件打不开 编辑:程序博客网 时间:2024/05/21 17:43

1.  从github上下载spring源码,地址:https://github.com/spring-projects/spring-framework/releases/tag/v3.2.10.RELEASE
              这里下载的是v3.2.10版本。

2.  解压刚刚下载的zip文件,打开“README.md”文件,查看当前Spring版本构建依赖的JDK版本

  ## Building from source
  The Spring Framework uses a [Gradle][]-based build system. In the instructions
  below, [`./gradlew`][] is invoked from the root of the source tree and serves as
  a cross-platform, self-contained bootstrap mechanism for the build. The only
  prerequisites are [Git][] and JDK 1.7+.
  该文件中指出构建时以来的JDK版本最低是1.7

3.  从Gradle官网下载Gradle软件,解压到指定目录,这里解压到 D:/gradle,进行环境配置,设置GRADLE_HOME,和PATH。 右键“计算机”-“属性”,进入“高级配置”,选择“环境变量”,点击”新建“,配置”GRADLE_HOME“为 D:/gradle;然后配置path属性:%GRADLE_HOME%\bin;配置完成后,在命令窗口输入“gradle -version”验证版本,如果显示版本号,表示gracle配置成功。

4.  双击spring framework根目录下的import-into-eclipse.bat,连续两次回车,等待其构建完成。

5.  在Eclipse菜单File->import选择General下面的Exsiting projects into workspace,导入Spring项目。


在这个步骤中,我出现的问题:

1.  双击spring framework根目录下的import-into-eclipse.bat 后,构建中途报错,报错信息(可通过录屏软件截取控制      台日志): 

         

    execution failed for task ':spring-core:compileTestJava'

     解决方案:是JDK版本导致。该Spring版本要求最低的JDK版本是1.7,而我的机器上版本是1.6.故构建出            错。

2.  导入Exsiting projects into workspace时,出现如下错误:

     Creation Problems Path for project must have only one segment. 

     解决方案:清理整个工作空间,project-clean,







0 0