• 搭建Spring源码环境


    搭建Spring源码环境

    1.下载Gradle

    本教程一定要下载下载Gradle6.8.2,否则可能出现种种问题。不要有太多纠结

    在gradle目录下的init.d文件夹下创建一个文件init.gradle填入下面的信息,目的是为了加快依赖的下载

    gradle.projectsLoaded {
        rootProject.allprojects {
            buildscript {
                repositories {
                    def JCENTER_URL = 'https://maven.aliyun.com/repository/jcenter'
                    def GOOGLE_URL = 'https://maven.aliyun.com/repository/google'
                    def NEXUS_URL = 'http://maven.aliyun.com/nexus/content/repositories/jcenter'
                    all { ArtifactRepository repo ->
                        if (repo instanceof MavenArtifactRepository) {
                            def url = repo.url.toString()
                            if (url.startsWith('https://jcenter.bintray.com/')) {
                                project.logger.lifecycle "Repository ${repo.url} replaced by $JCENTER_URL."
                                println("buildscript ${repo.url} replaced by $JCENTER_URL.")
                                remove repo
                            }
                            else if (url.startsWith('https://dl.google.com/dl/android/maven2/')) {
                                project.logger.lifecycle "Repository ${repo.url} replaced by $GOOGLE_URL."
                                println("buildscript ${repo.url} replaced by $GOOGLE_URL.")
                                remove repo
                            }
                            else if (url.startsWith('https://repo1.maven.org/maven2')) {
                                project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                                println("buildscript ${repo.url} replaced by $REPOSITORY_URL.")
                                remove repo
                            }
                        }
                    }
                    jcenter {
                        url JCENTER_URL
                    }
                    google {
                        url GOOGLE_URL
                    }
                    maven {
                        url NEXUS_URL
                    }
                }
            }
            repositories {
                def JCENTER_URL = 'https://maven.aliyun.com/repository/jcenter'
                def GOOGLE_URL = 'https://maven.aliyun.com/repository/google'
                def NEXUS_URL = 'http://maven.aliyun.com/nexus/content/repositories/jcenter'
                all { ArtifactRepository repo ->
                    if (repo instanceof MavenArtifactRepository) {
                        def url = repo.url.toString()
                        if (url.startsWith('https://jcenter.bintray.com/')) {
                            project.logger.lifecycle "Repository ${repo.url} replaced by $JCENTER_URL."
                            println("buildscript ${repo.url} replaced by $JCENTER_URL.")
                            remove repo
                        }
                        else if (url.startsWith('https://dl.google.com/dl/android/maven2/')) {
                            project.logger.lifecycle "Repository ${repo.url} replaced by $GOOGLE_URL."
                            println("buildscript ${repo.url} replaced by $GOOGLE_URL.")
                            remove repo
                        }
                        else if (url.startsWith('https://repo1.maven.org/maven2')) {
                            project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                            println("buildscript ${repo.url} replaced by $REPOSITORY_URL.")
                            remove repo
                        }
                    }
                }
                jcenter {
                    url JCENTER_URL
                }
                google {
                    url GOOGLE_URL
                }
                maven {
                    url NEXUS_URL
                }
            }
        }
    }
    

    2. 下载Spring源码

    下载Spring源码之后fork一份到自己的仓库,因为还要给代码添加注释,所以保存自己仓库一份为好

    image

    3. 配置

    下载openjdk15,一定要用15啊,用别的可能会出现问题。

    image

    image

    image

    4. 测试

    image

    image

    测试通过
    image

  • 相关阅读:
    angular 路由动态加载JS文件
    使用AngularJS处理单选框和复选框的简单方法
    angularjs 请求后端接口请求了两次
    angular ui.router 路由传参数
    linux 安装svn服务器
    gulp css 压缩 合并
    ajax 实现跨域
    [codeforces 1366D] Two Divisors
    Namomo Test Round 1 题解
    Race(淀粉质)
  • 原文地址:https://www.cnblogs.com/smallwolf/p/15827313.html
Copyright © 2020-2023  润新知