Windows7下Spring源码的下载与配置

1、下载源码

  • download and install GitHub 
  • create local directory to store source files , for example d:\spring4
  • execute following commands:

cd d:\spring4

git clone git://github.com/SpringSouce/Spring-framework.git

cd d:\spring4-security

git clone git://github.com/SpringSouce/Spring-security.git


其他版本的下载地址:https://github.com/spring-projects/spring-framework/tags


2、准备eclipse项目(必须以管理员身份运行命令行)

cd d:\spring4

import-into-eclipse


3、错误处理

  • can not resolve services.gradle.org ... download failed....

edit C:\Windows\System32\drivers\etc\hosts , add following configuration to the tail:

207.223.250.8services.gradle.org

  • Could not GET 'https://repo.spring.io/...
download the file mannually or try once more

u can copy file to gradle local cache

the gradle local cache directory is :C:\Users\%USERNAME%\.gradle\caches

for example , if the error is 

Could not resolve all dependencies for configuration ':spring-context:compile'.
> Could not download artifact 'jruby-core.jar (org.jruby:jruby-core:1.7.19)'
   > Could not GET 'https://repo.spring.io/libs-release/org/jruby/jruby-core/1.7
.19/jruby-core-1.7.19.jar'.
      > d29vzk4ow07wi7.cloudfront.net

u can copy the url to browser : https://repo.spring.io/libs-release/org/jruby/jruby-core/1.7.19/jruby-core-1.7.19.jar

u will find the redirect url in thunder :


u should copy the file name  2d034d7407a91994b45338e5dd1821faea534e84

make the dir in cache as follows :

C:\Users\%USERNAME%\.gradle\caches\modules-2\files-2.1\org.jruby\jruby-core\1.7.19\2d034d7407a91994b45338e5dd1821faea534e84

copy the downloaded file (jruby-core-1.7.19.jar) 

re-execute the command : import-into-eclipse


4、我的日志

Could not resolve all dependencies for configuration ':spring-context:compile'.
> Could not download artifact 'jruby-core.jar (org.jruby:jruby-core:1.7.19)'
   > Could not GET 'https://repo.spring.io/libs-release/org/jruby/jruby-core/1.7
.19/jruby-core-1.7.19.jar'.
      > d29vzk4ow07wi7.cloudfront.net

2d034d7407a91994b45338e5dd1821faea534e84


> Could not resolve all dependencies for configuration ':spring-context-support:
compile'.
   > Could not download artifact 'quartz.jar (org.quartz-scheduler:quartz:2.2.1)
'
      > Could not GET 'https://repo.spring.io/libs-release/org/quartz-scheduler/quartz/2.2.1/quartz-2.2.1.jar'.
         > Software caused connection abort: recv failed

2bd17ec0c66d0370a932e225f52c23f3dc7cc4ce


> Could not resolve all dependencies for configuration ':spring-orm:compile'.
   > Could not download artifact 'javax.persistence.jar (org.eclipse.persistence
:javax.persistence:2.0.5)'
      > Could not GET 'https://repo.spring.io/libs-release/org/eclipse/persistence/javax.persistence/2.0.5/javax.persistence-2.0.5.jar'.
         > d29vzk4ow07wi7.cloudfront.net

e28c710137a7e6eba12ba95217c5ea0db5e71b83



5、执行完毕的提示信息

BUILD SUCCESSFUL


Total time: 32 mins 14.36 secs


-----------------------------------------------------------------------
STEP 2: Import subprojects into Eclipse/STS


Within Eclipse/STS, do the following:


File > Import... > Existing Projects into Workspace
     > When prompted for the 'root directory', provide D:\Work\research\open_sou
rce\spring\Spring-framework\
     > Press enter. You will see the modules show up under "Projects"
     > All projects should be selected/checked. Click Finish.
     > When the project import is complete, you should have no errors.







  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要编译Spring源码,你需要先安装JDK并下载Spring源码。你可以从Spring官方的GitHub库中下载源码,链接是https://github.com/spring-projects/spring-framework。如果你觉得下载速度慢,也可以使用这个已经下载好的链接:https://pan.baidu.com/s/18lEeQCwQKo1E4bli4SAJ2A 提取码:dvda。一旦你下载好了源码,你可以按照以下步骤进行编译: 1. 配置好JDK环境变量,确保你可以在命令行或终端中运行Java和Javac命令。 2. 打开命令行或终端,进入到你下载好的Spring源码的根目录。 3. 运行命令`./gradlew build`(对于Windows系统,运行`gradlew.bat build`),这将使用Gradle构建项目并编译源码。 4. 等待编译完成,你可以在构建目录中找到生成的编译结果。 请注意,编译Spring源码可能需要一些时间和计算资源,同时也需要一些基本的编译知识和工具配置。建议你在编译之前先阅读Spring官方文档中关于构建和编译的指南,以确保你有必要的环境和了解编译的要求。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [spring源码编译](https://blog.csdn.net/jiayoubaobei2/article/details/127311223)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [spring源码编译完整版](https://blog.csdn.net/qq_39409977/article/details/107904932)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值