使用Gradle编译Spring源码(Idea)

下载Spring源码

推荐从码云上下载Spring源码下载地址可以自己选择版本,通过git clone 或者下载zip解压都可以

更改Gradle下载依赖为阿里云

阿里云私库列表 选择public 和 spring就可以了,在build.gradle中添加如下代码

buildscript {
     
    repositories {
     
        maven {
      url 'https://maven.aliyun.com/nexus/content/groups/public' }
        maven {
      url 'https://maven.aliyun.com/repository/spring' }
    }
}
//295行左右
repositories {
     
			maven {
      url 'https://maven.aliyun.com/nexus/content/groups/public' }
			maven {
      url 'https://maven.aliyun.com/repository/spring' }
			mavenCentral()
			maven {
      url "https://repo.spring.io/libs-spring-framework-build" }
			maven {
      url "https://repo.spring.io/milestone" } // Reactor
		}

执行

cmd 执行 ./gradlew :spring-oxm:compileTestJava
再通过idea (File -> New -> Project from Existing Sources -> Navigate to directory -> Select build.gradle) 搞定

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