Import the configured source code

Cloud warehouse configured code, download after switch to the corresponding branch can be run directly jdk11 domestic mirror: mirrors.tuna.tsinghua.edu.cn/AdoptOpenJD… Spring version: 5.3.4 Spring Code Cloud address: gitee.com/tangjingsha… Springboot version: 2.4.3 SpringBoot code Cloud address: gitee.com/tangjingsha… Git checkout nicky5.3.4: git checkout nickyStudy5.3.4

Build springframework source code first, and then build springboot source code

  1. Download jdK11 to the specified directory
  2. Get the code cloud code
git checkout nicky53.4.
Copy the code
  1. Idea import two projects (import, such as automatic build, end first)

  2. Change the JDK version of Idea gradle

  1. Change the JDK version of the project for IDEA and configure to build the project using the gradle-wrapper.properties configuration, otherwise there will be version problems

  1. build project

  1. Execute publishToMavenLocal under the springframework and package it into a local repository

  1. Run the stduy demo

Spring demo path: org. Springframework. Study. TestRegisterBean# main

Springboot path: org. Springframework. Boot. Sutdy. SpringBootStudyApplication# main

Springframework source code environment construction

  1. Fork the source code to the code cloud repository, download it locally, switch to the branch you want, and then create your own branch based on that branch

Use gradle-wrapper.properties to build the project, otherwise there will be version problems

  1. Import the project, at which point it may automatically build the project, forcing the end first. Depending on the Spring version, configure the JDK. Spring 5.4.3 requires JDK11
JDK13https://mirrors.tuna.tsinghua.edu.cn/AdoptOpenJDK/11/jdk/x64/linux/
Copy the code
  1. Change the related image to Ali Cloud image
- Global search'repositories {'MavenLocal () maven {url'https://maven.aliyun.com/nexus/content/groups/public/' }
	maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
Copy the code

  1. When checkStyle is disabled, comment out the checkstyle-related code to avoid mandatory code checks when adding comments
File address: Spring-Framework/build.gradle global search, checkStyle and JavaformatCopy the code

  1. Turn off idea automatic formatting, otherwise all files will be formatted globally when packaged
File address: the Spring Framework/SRC/idea/Spring - Framework. The XMLCopy the code

  1. Remove unit tests, Javadoc
File address: /tjs-workspace/spring-boot/build.gradle Add subprojects {tasks.withtype (Javadoc).all {enabled =false
    }
    tasks.withType(Test).all {
        enabled = false}}Copy the code
  1. Create your own test module and import the required packages. Using AnnotationConfigApplicationContext annotation-based loading beans to the ioc
  • Pit 1, new module. Gradle configuration file, must be named specification. Gradle configuration file must be spring-study. Gradle configuration file must be spring-study. Gradle configuration file must be spring-study.

  1. Executing test examples

  1. Package to a local repository for later springBoot import
  • Error: Javadoc: warning…..

    Unknown use, comment out related code: global search “project.ext.javadocLinks”, comment out

  • Error: / Spring Framework/build/docs/javadoc/package – the list (not the file or directory)

    Unknown, comment out the relevant code: gradle/docs. Gradle: externalDocumentationLink there may be other errors, does not affect the study of related classes, can be commented out

Springboot source code environment construction

Basically the same, except for the following

  1. Speed up startup by removing irrelevant project dependencies
The file address is /tjs-workspace/spring-boot/settings.gradleCopy the code

4. Springboot integrates local springframework aggregation projects

Aggregate projects for easier integration testing, to be continued…

General train of thought1.Merge the buildSrc, root. Gradle, of both projects2.The.gradle file changes where springboot introduces the springframeworkCopy the code