# Spring5源码分析
**Repository Path**: sxudong/spring-framework-analysis
## Basic Information
- **Project Name**: Spring5源码分析
- **Description**: 【直接clone,可以运行,有问题issues】Spring源码深度分析,IoC、AOP、BeanFactory、BeanDefinition解析、循环依赖等等
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: https://blog.csdn.net/ganquanzhong/article/details/100401914
- **GVP Project**: No
## Statistics
- **Stars**: 2
- **Forks**: 286
- **Created**: 2021-10-20
- **Last Updated**: 2025-04-06
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
[](https://gitee.com/zhong96/spring-framework-analysis)[](https://gitee.com/zhong96/spring-framework-analysis/members)
- [IDEA](https://www.cnblogs.com/gqzdev/p/idea.html)
- [JDK8以上](https://www.oracle.com/technetwork/java/javase/overview/index.html)
- [Gradle4.10.3](https://services.gradle.org/distributions/) 注:最好不要使用高版本的,或许会存在settings.gradle配置问题
Spring Framework 5源码研读分析
从Spring开始走向成功
## 导入教程:
1. 🔥下载源码【Spring源码已经经过了处理,[下载后按照下面的步骤进行测试](https://blog.csdn.net/ganquanzhong/article/details/100401914)】
```shell
# 如果你想要一个干净的源码环境,请clone init分支
git clone https://gitee.com/zhong96/spring-framework-analysis.git
# 如果你的网比较好,也可以clone github上面的仓库
git clone https://github.com/gqzdev/spring-framework-analysis
```
2. 在[idea](https://www.cnblogs.com/gqzdev/p/idea.html)中导入`spring5`源码
参考根目录下的`import-into-idea.md`文档导入源码运行。
修改 gradle/wrapper/gradle-wrapper.properties 中使用的 gradle版本:
```shell
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip
# 版本不对 compileTestJava 报错:
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'git'
spring-framework-5.1.x.RELEASE 版本默认都是 gradle-4.10.3-all.zip
配置安装好的gradle环境变量:
我的电脑->属性->高级系统设置->环境变量->新建
GRADLE_USER_HOME=D:\Program Files\gradle\gradle-4.10.3
继续在【系统变量】下找到Path变量,双击打开,新建变量输入:%GRADLE_USER_HOME%\bin,确保能够在cmd命令行直接执行gradle命令: gradle -v
如果不更新git 远程仓库报:detected dubious ownership in repository at
https://blog.csdn.net/Java_ZZZZZ/article/details/135744749
git config --global --add safe.directory F:/code/spring-framework-analysis
```
注意项目编译用的JDK用 JDK8, 不能用 JDK8以上编译,同时不能升级 gradle/wrapper/gradle-wrapper.properties 中的 gradle 版本,只能用 4-10.3。
3. 资源

[Spring官方文档中文版](https://www.springcloud.cc/spring-reference.html)
[Spring Framework](https://spring.io/projects/spring-framework)
[Spring Framework 5.2.0.BUILD-SNAPSHOT API](https://docs.spring.io/spring/docs/5.2.0.BUILD-SNAPSHOT/javadoc-api/)
[快速了解](https://www.cnblogs.com/gqzdev/p/11667328.html)
## 中文:
这是Spring框架的所在地:所有[Spring项目](https://spring.io/projects)的基础。 总体来说,Spring框架和Spring项目系列通常简称为“ Spring”。
Spring提供了Java编程语言以外的所有需要,可用于为各种场景和体系结构来创建企业应用程序。 请阅读[概述](https://docs.spring.io/spring/docs/current/spring-framework-reference/overview.html#spring-introduction)部分作为参考,以获取更完整的介绍。
## 编码准则
此项目受[Spring行为准则](CODE_OF_CONDUCT.adoc)的约束。 通过参与,您将遵守此行为准则。 请向spring-code-of-conduct@pivotal.io报告不可接受的行为。
## 访问二进制文件
有关对工件或分发zip的访问,请参见[Spring Framework Artifacts](https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Artifacts)Wiki页面。
## 文档
Spring框架维护参考文档([已发布](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/)和[source](src/docs/asciidoc)),Github [wiki页面](https://github.com/spring-projects/spring-framework/wiki),以及
API参考](https://docs.spring.io/spring-framework/docs/current/javadoc-api/)。 Spring项目中也有[guides and tutorials](https://spring.io/guides)
## 从源代码构建
请参阅[从源构建](https://github.com/spring-projects/spring-framework/wiki/Build-from-Source)Wikipedia页面和[CONTRIBUTING.md](CONTRIBUTING.md)文件。
## 保持联系
关注[@SpringCentral](https://twitter.com/springcentral),[@SpringFramework](https://twitter.com/springframework)及其[团队成员](https://twitter.com/springframework/lists/team/members)。可以在[The Spring Blog](https://spring.io/blog/)上找到深入的文章,并通过我们的[news feed](https://spring.io/blog/category/news)宣布发布。 )。
## 执照
Spring Framework是在[Apache许可](https://www.apache.org/licenses/LICENSE-2.0)的2.0版下发布的。
## 英文:
This is the home of the Spring Framework: the foundation for all [Spring projects](https://spring.io/projects). Collectively the Spring Framework and the family of Spring projects is often referred to simply as "Spring".
Spring provides everything required beyond the Java programming language for creating enterprise applications for a wide range of scenarios and architectures. Please read the [Overview](https://docs.spring.io/spring/docs/current/spring-framework-reference/overview.html#spring-introduction) section as reference for a more complete introduction.
## Code of Conduct
This project is governed by the [Spring Code of Conduct](CODE_OF_CONDUCT.adoc). By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.
## Access to Binaries
For access to artifacts or a distribution zip, see the [Spring Framework Artifacts](https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Artifacts) wiki page.
## Documentation
The Spring Framework maintains reference documentation ([published](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/) and [source](src/docs/asciidoc)), Github [wiki pages](https://github.com/spring-projects/spring-framework/wiki), and an
[API reference](https://docs.spring.io/spring-framework/docs/current/javadoc-api/). There are also [guides and tutorials](https://spring.io/guides) across Spring projects.
## Build from Source
See the [Build from Source](https://github.com/spring-projects/spring-framework/wiki/Build-from-Source) Wikipedia page and the [CONTRIBUTING.md](CONTRIBUTING.md) file.
## Stay in Touch
Follow [@SpringCentral](https://twitter.com/springcentral), [@SpringFramework](https://twitter.com/springframework), and its [team members](https://twitter.com/springframework/lists/team/members) on Twitter. In-depth articles can be found at [The Spring Blog](https://spring.io/blog/), and releases are announced via our [news feed](https://spring.io/blog/category/news).
## License
The Spring Framework is released under version 2.0 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0).
## 做一个坚持学习的人,加油!:v: