解读Spring源码之前的准备
请忽略以下的文章,现在回过头来才发现学习源码不用如此复杂
1.IDEA 新建一个maven项目,
2.pom 中倒入 spring5 的基本包,然后利用maven 插件down下源码
3.然后就可以开始,源码分析了。
4.需要做笔记的地方自己摘抄下来即可。
---------------------------------
---------------------------------
---------------------------------
1.安装gradle
spring没有通过maven 构建项目,而是gradle,(点击下载)
gradle 的配置参考 Maven 在Mac下的配置,类似
2.下载源码导入idea,
eclipse的导入我就不讲了,毕竟《spring源码深度解析》就是这么一步一步喂给我们的
我直接下载的spring-framework-master.zip,解压,导入idea那就要看这个import-into-idea.md这个文件了
The following has been tested against IntelliJ IDEA 2016.2. ## Steps _Within your locally cloned spring-framework working directory:_ . Precompile `spring-oxm` with `./gradlew :spring-oxm:compileTestJava`
. Import into IntelliJ (File -> New -> Project from Existing Sources -> Navigate to directory -> Select build.gradle)
. When prompted exclude the `spring-aspects` module (or after the import via File-> Project Structure -> Modules)
. Code away ## Known issues . `spring-core` and `spring-oxm` should be pre-compiled due to repackaged dependencies.
See `*RepackJar` tasks in the build and https://youtrack.jetbrains.com/issue/IDEA-160605).
. `spring-aspects` does not compile due to references to aspect types unknown to
IntelliJ IDEA. See http://youtrack.jetbrains.com/issue/IDEA-64446 for details. In the meantime, the
'spring-aspects' can be excluded from the project to avoid compilation errors.
. While JUnit tests pass from the command line with Gradle, some may fail when run from
IntelliJ IDEA. Resolving this is a work in progress. If attempting to run all JUnit tests from within
IntelliJ IDEA, you will likely need to set the following VM options to avoid out of memory errors:
-XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m
. If you invoke "Rebuild Project" in the IDE, you'll have to generate some test
resources of the `spring-oxm` module again (`./gradlew :spring-oxm:compileTestJava`) ## Tips In any case, please do not check in your own generated .iml, .ipr, or .iws files.
You'll notice these files are already intentionally in .gitignore. The same policy goes for eclipse metadata. ## FAQ Q. What about IntelliJ IDEA's own [Gradle support](http://confluence.jetbrains.net/display/IDEADEV/Gradle+integration)? A. Keep an eye on http://youtrack.jetbrains.com/issue/IDEA-53476
大致意思就是:
2.1.预编译`spring-core` and `spring-oxm` ,以spring-core为例,切到该目录,输入命令如图:
如果下载太慢不能忍受,记得科学上网

2.2.导入idea中
Import into IntelliJ (File -> New -> Project from Existing Sources -> Navigate to directory -> Select build.gradle)
2.3.移除 `spring-aspects` module ,说是这个模块会编译错误
2.4.然后就开始Code !!
3.最后环境
另外:gradle的基本用法可以了解下 https://gradle.org/guides/
我们的工作环境还是要说下:spring 5.0 , jdk1.8, gradle 4.0, idea 2017.2

解读Spring源码之前的准备的更多相关文章
- Spring 源码 (2)Spring IOC 容器 前戏准备工作
Spring 最重要的方法refresh方法 根据上一篇文章 https://www.cnblogs.com/redwinter/p/16141285.html Spring Bean IOC 的创建 ...
- Spring源码之SimpleAliasRegistry解读(一)
Spring源码之SimpleAliasRegistry解读(一) 阅读spring源码中org.springframework.core.SimpleAliasRegistry类时发现该类主要是使用 ...
- Spring源码-循环依赖源码解读
Spring源码-循环依赖源码解读 笔者最近无论是看书还是从网上找资料,都没发现对Spring源码是怎么解决循环依赖这一问题的详解,大家都是解释了Spring解决循环依赖的想法(有的解释也不准确,在& ...
- Spring源码解读之BeanFactoryPostProcessor的处理
前言 前段时间旁听了某课堂两节Spring源码解析课,刚好最近自己又在重新学习中,便在这里记录一下学习所得.我之前写过一篇博文,是介绍BeanFactoryPostProcessor跟BeanPost ...
- Spring源码解读--(一)源码下载
走在Java程序员这条路上,网上Java各种工具满天飞,写个简单的CRUD,相信是个开发都能写出来,于是在思考如何可以在同行业中更有竞争力(其实就是如何赚更多钱).那么,老大给我推荐了Spring源码 ...
- 【Spring源码解读】bean标签中的属性
说明 今天在阅读Spring源码的时候,发现在加载xml中的bean时,解析了很多标签,其中有常用的如:scope.autowire.lazy-init.init-method.destroy-met ...
- Spring源码解读:核心类DefaultListableBeanFactory的继承体系
1 简介 我们常用的ClassPathXmlApplicationContext是AbstractRefreshableApplicationContext的子类,而DefaultListableBe ...
- Spring源码分析——BeanFactory体系之抽象类、类分析(一)
上一篇介绍了BeanFactory体系的所有接口——Spring源码分析——BeanFactory体系之接口详细分析,本篇就接着介绍BeanFactory体系的抽象类和接口. 一.BeanFactor ...
- Spring源码情操陶冶-AbstractApplicationContext#obtainFreshBeanFactory
前言-阅读源码有利于陶冶情操,本文承接前文Spring源码情操陶冶-AbstractApplicationContext 约束: 本文指定contextClass为默认的XmlWebApplicati ...
随机推荐
- python3.x 基础三:字符集问题
总结了一张表,更详细信息百度百科: 序号 年份 编码 标准协会 特点 二进制长度 字符长度 表现 1 1967 ASCII 美国国家标准学会(American National Standard In ...
- 201771010128王玉兰《面向对象程序设计(Java)》第十二周学习总结
第一部分:理论知识 1.AWT与Swing简介 (1)Swing用户界面库是非基于对等体的GUI工具箱. Swing具有更丰富并且更方便的用户界面元素集合. Swing对底层平台的依赖很少,因此与 ...
- dubbo分布式应用
dubbo介绍: dubbo是一款分布式服务框架,支持高性能和透明化的RPC远程服务调用方案,每天为2千多个服务提供大于30亿次访问量支持,并被广泛应用于阿里巴巴集团的各成员站点以及别的公司的业务中. ...
- Angular SPA基于Ocelot API网关与IdentityServer4的身份认证与授权(三)
在前面两篇文章中,我介绍了基于IdentityServer4的一个Identity Service的实现,并且实现了一个Weather API和基于Ocelot的API网关,然后实现了通过Ocelot ...
- iOS 的尾调用优化原理
背景: 今天聊代码规范的问题的时候说了一下尾调用的问题. 一:概念: 什么是尾调用? 尾调用(Tail Call):某个函数的最后一步仅仅只是调用了一个函数(可以是自身,可以是另一个函数). 注意 “ ...
- rancher证书过期
背景 无法打开rancher服务,报错如下截图,可以看出是证书过期了无法连上k8s,注意这里的证书是rancher自身证书并非k8s证书. 解决方法 rancher升级:https://rancher ...
- 关于如何查看论文是否被SCI或者EI收录
最好的方法,在高校图书馆网站上进行查询. 另外还有就是去对应网站查询: SCI:https://apps.webofknowledge.com/UA_GeneralSearch_input.do?pr ...
- Python 每日一练(7)
引言 今天的练习比较轻松,原本是有两题的,但是第一题那个大致看了一下,其实和之前的6个练习差不多,就是把xls中的文件数据读取出来后,进行一下处理,对于那题而言就是一个求和操作,所以就没练了,所以今天 ...
- 处理异常方式try_catch_finally, throws,throw
如何处理 Exception 的异常: 抓抛模型:1.抓:异常的处理,有两种方式①try-catch-finally ②throws+异常类型 2.抛:一旦执行过程中出现异常,会抛出一个异常类的对 ...
- 【转】eclipse找不到或无法加载主类
Eclipse错误: 找不到或无法加载主类或项目无法编译10种解决大法! 今天启动项目,又遇到找不到或无法加载主类的情况,清除项目后无法编译,bin文件夹下没有.class文件,至少遇到3次这个问题了 ...
