2021-01-23

spring源码编译:

             环境准备:

  1.   jdk:

    java version "1.8.0_271"
    Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
    Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)

    gradle版本:

  2. Gradle 5.6.4
    ------------------------------------------------------------
    
    Build time:   2019-11-01 20:42:00 UTC
    Revision:     dd870424f9bd8e195d614dc14bb140f43c22da98
    
    Kotlin:       1.3.41
    Groovy:       2.5.4
    Ant:          Apache Ant(TM) version 1.9.14 compiled on March 12 2019
    JVM:          1.8.0_271 (Oracle Corporation 25.271-b09)
    OS:           Windows 7 6.1 amd64

     

  3. idea版本:2020.3

  4. spring源码

    
    git clone -b 5.2.x https://github.com/spring-projects/spring-framework.git

    idea设置gradle

  5.  

    1. 2021-01-23_第1张图片
    2. 导入项目

    3. 2021-01-23_第2张图片

    4. 更改 spring项目中的 build.gradle文件

    5.  

      1、注释掉 plugins 里面的    id 'io.spring.gradle-enterprise-conventions' version '0.0.2' 

      2、注释掉checkeStyle 相关的配置

      加入下面代码

      allprojects {
      	repositories {
      		maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
      		maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
      		maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
      		maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
      		maven { url "https://repo.spring.io/libs-spring-framework-build" }
      	}
      }

      settings.gradle文件中maven url换成:

      maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}

      .

    编译完成功后,新建module

    2021-01-23_第3张图片

    2021-01-23_第4张图片xin

 

新建的module  中的build.gradle文件加入

 compile(project(":spring-context"))

2021-01-23_第5张图片                        

     到此为止完成。主要问题是gradle的版本问题。gradle下载慢可以去腾讯镜像库下载  https://mirrors.tencent.com/    

              

你可能感兴趣的:(gradle,spring,java)