第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

Spring源碼導(dǎo)入Eclipse

標(biāo)簽:
Spring

最近开始阅读 Spring 源码,一步步教大家我是如何阅读的。

1.下载源文件

我使用的图形化工具 SourceTree 下载 github 上的源码,拉取 https://github.com/spring-projects/spring-framework.git 文件,挺多的、
图片描述

2.编译

参考 import-into-eclipse.md 文件进行导入工程
2.1 下载安装好 gradle 然后配置 gradle 环境变量,执行 gradlew.bat 我的目录是 I:\mygit\java\spring-framework-src
图片描述

2.2 确保 eclipse 使用的 JDK8 以上的
2.3 安装 [Kotlin Plugin for Eclipse] 打开Eclipse,使用Help -> Eclipse Marketplace… 菜单,搜索 Kotlin 插件,并安装
图片描述

2.4 安装 [Eclipse Groovy Development Tools] ,查找自己 eclipse 版本 help->About Eclipse

图片描述

2.5 打开eclipse,在eclipse中,选择help -> Install New Software… 粘贴地址,全选并下一步,进行安装
图片描述

2.6 在 Eclipse 中转换 Groovy 2.5 (Preferences -> Groovy -> Compiler -> Switch to 2.5…)
图片描述

2.7 修改参数
(Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and restricted API -> Forbidden reference (access rule)).
图片描述

2.8 (可选择)如果需要 spring-aspects 项目.安装 AspectJ Development Tools (AJDT)
2.9 通过命令行 ./gradlew :spring-oxm:check.构建 spring-oxm
图片描述

3.0 命令行执行 ./gradlew eclipseBuildship
图片描述

3.导入 Eclipse

(File -> Import -> Existing Projects into Workspace -> Select root directory -> Browse spring-framework-src directory -> Select Finish).

阅读

然后我们就可以愉快的开始阅读源码了……确实很枯燥的源码,建议结合书还有 Demo 代码来理解其中的含义,代码量还是蛮多的,而且,注释基本都英文的,所以想学好代码,英语还是不能差的。

原文步骤:Steps

When instructed to execute ./gradlew from the command line, be sure to execute it within your locally cloned spring-framework working directory.

  1. Ensure that Eclipse launches with JDK 8.
    • For example, on Mac OS this can be configured in the Info.plist file located in the Contents folder of the installed Eclipse or STS application (e.g., the Eclipse.app file).
  2. Install the Kotlin Plugin for Eclipse in Eclipse.
  3. Install the Eclipse Groovy Development Tools in Eclipse.
  4. Switch to Groovy 2.5 (Preferences -> Groovy -> Compiler -> Switch to 2.5…) in Eclipse.
  5. Change the Forbidden reference (access rule) in Eclipse from Error to Warning
    (Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and restricted API -> Forbidden reference (access rule)).
  6. Optionally install the AspectJ Development Tools (AJDT) if you need to work with the spring-aspects project.
  7. Optionally install the TestNG plugin in Eclipse if you need to execute TestNG tests in the spring-test module.
  8. Build spring-oxm from the command line with ./gradlew :spring-oxm:check.
  9. To apply project specific settings, run ./gradlew eclipseBuildship from the command line.
  10. Import into Eclipse (File -> Import -> Gradle -> Existing Gradle Project -> Navigate to the locally cloned spring-framework directory -> Select Finish).
    • If you have not installed AJDT, exclude the spring-aspects project from the import, if prompted, or close it after the import.
    • If you run into errors during the import, you may need to set the Java home for Gradle Buildship to the location of your JDK 8 installation in Eclipse (Preferences -> Gradle -> Java home).
  11. If you need to execute JAXB-related tests in the spring-oxm project and wish to have the generated sources available, add the build/generated-sources/jaxb folder to the build path (right click on the jaxb folder and select Build Path -> Use as Source Folder).
    • If you do not see the build folder in the spring-oxm project, ensure that the “Gradle build folder” is not filtered out from the view. This setting is available under “Filters” in the configuration of the Package Explorer (available by clicking on the small downward facing arrow in the upper right corner of the Package Explorer).
  12. Code away!

总结

Spring 最主要的是理解 Bean 的概念,理解 AOP 、 IOC,最好是结合实际的代码,而不是只看源码。
1024,程序员们要加油鸭!

點擊查看更多內(nèi)容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
JAVA開發(fā)工程師
手記
粉絲
31
獲贊與收藏
155

關(guān)注作者,訂閱最新文章

閱讀免費教程

  • 推薦
  • 評論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評論
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊有機(jī)會得

100積分直接送

付費專欄免費學(xué)

大額優(yōu)惠券免費領(lǐng)

立即參與 放棄機(jī)會
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消