Giter Site home page Giter Site logo

gqzdev / spring-framework-analysis Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 10.0 16.33 MB

🎈🎈🎈spring-framework源码分析,理解Spring的原理

License: Apache License 2.0

Groovy 0.10% Java 99.02% HTML 0.13% AspectJ 0.08% Kotlin 0.45% JavaScript 0.01% GAP 0.02% PLpgSQL 0.01% CSS 0.14% FreeMarker 0.04% Ruby 0.01% Python 0.01% Smarty 0.01% XSLT 0.01% Batchfile 0.01%
spring spring-analysis spring-framework

spring-framework-analysis's Introduction

starforkGitHub

  • IDEA

  • JDK8以上

  • Gradle4.10.3 注:最好不要使用高版本的,或许会存在settings.gradle配置问题

    Spring Framework 5源码研读分析
    从Spring开始走向成功
  1. 🔥下载源码【Spring源码已经经过了处理,下载后按照下面的步骤进行测试
# 如果你想要一个干净的源码环境,请clone init分支
git clone https://gitee.com/zhong96/spring-framework-analysis.git

# 如果你的网比较好,也可以clone github上面的仓库
git clone https://github.com/gqzdev/spring-framework-analysis
  1. idea中导入spring5源码构建时,spring-core模块报错,缺失cglib相关的jar包依赖。

    gradle配置,可以使用自己下载的gradle,也可以用gradle-warpper.properties中的。在这里插入图片描述

为了避免第三方class的冲突,Spring把最新的cglibobjenesis给重新打包(repack)了,它并没有在源码里提供这部分的代码,而是直接将其放在jar包当中,这也就导致了我们拉取代码后出现编译错误。那么为了画过编译,我们要把缺失的jar补回来

添加cglib和objenesis

  1. Aspectj编译问题解决,主要是aspectj关键字Java语法违背,需要使用ajc编译器执行。下面就切换ajc编译器,首先需要下载aspectj,并且安装。
  • 为spring-aspect工程添加Facets属性 为spring-aspect工程添加Facets属性
  • 编译器要改为Ajc,同时要设置Ajc的安装目录,如图1-27所示。记住,要选择到a spec飞jtools.jar这个层面,同时,务必要边择Delegateto Javac选顷,它的作用是只编译AspectJ的Facets项目,而其他则使用JDK代理。如果不勾选,则全部使用Ajc编译,那么会导致编译错误。 编译器要改为Ajc
  1. idea中导入spring5源码构建时,spring-oxm模块报错。

    💡解决办法:在gradle中找到spring-oxm的genCastorgenJaxb命令。 在这里插入图片描述

经过上面的jar修复操作后,在依赖library中应该有以下几个模块!!!!

library依赖

  1. 🧨build finish 在这里插入图片描述

新建一个测试模块(spring-mytest),后面分析源码时都是建立一个相关的module。详细请看!

测试环境搭建

  1. 资源

    SpringIoc

Spring官方文档中文版

Spring Framework

Spring Framework 5.2.0.BUILD-SNAPSHOT API

快速了解

中文:

​ 这是Spring框架的所在地:所有Spring项目的基础。 总体来说,Spring框架和Spring项目系列通常简称为“ Spring”。

​ Spring提供了Java编程语言以外的所有需要,可用于为各种场景和体系结构来创建企业应用程序。 请阅读概述部分作为参考,以获取更完整的介绍。

编码准则

​ 此项目受Spring行为准则的约束。 通过参与,您将遵守此行为准则。 请向[email protected]报告不可接受的行为。

访问二进制文件

​ 有关对工件或分发zip的访问,请参见Spring Framework ArtifactsWiki页面。

文档

​ Spring框架维护参考文档(已发布source),Github wiki页面,以及 API参考。 Spring项目中也有guides and tutorials

从源代码构建

​ 请参阅从源构建Wikipedia页面和CONTRIBUTING.md文件。

保持联系

​ 关注@SpringCentral@SpringFramework及其团队成员。可以在The Spring Blog上找到深入的文章,并通过我们的news feed宣布发布。 )。

执照

​ Spring Framework是在Apache许可的2.0版下发布的。

英文:

This is the home of the Spring Framework: the foundation for all Spring 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 section as reference for a more complete introduction.

Code of Conduct

This project is governed by the Spring Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to [email protected].

Access to Binaries

For access to artifacts or a distribution zip, see the Spring Framework Artifacts wiki page.

Documentation

The Spring Framework maintains reference documentation (published and source), Github wiki pages, and an API reference. There are also guides and tutorials across Spring projects.

Build from Source

See the Build from Source Wikipedia page and the CONTRIBUTING.md file.

Stay in Touch

Follow @SpringCentral, @SpringFramework, and its team members on Twitter. In-depth articles can be found at The Spring Blog, and releases are announced via our news feed.

License

The Spring Framework is released under version 2.0 of the Apache License.

spring-framework-analysis's People

Contributors

gqzdev avatar zhong96 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.