spring-framework6.x版本源码构建

6.x.修改gradle仓库构建

IDEA版本及gradle构建设置

image-20240122134844474

image-20240122141828945

在gradle指定仓库地址/wrapper/dists/找到与gradle wrapper相对应的gradle版本,在gradle的init.d/目录下新建init.gradle文件,内容如下:

allprojects{
    repositories {
        mavenLocal()
        maven { url 'https://maven.aliyun.com/repository/public/' }
        maven { url 'https://maven.aliyun.com/repository/jcenter/' }
        maven { url 'https://maven.aliyun.com/repository/google/' }
        maven { 
			url 'http://私库地址/repository/gradle-distribution/'
			allowInsecureProtocol = true
		}
        maven { url 'https://jitpack.io/' }
    }
}
settingsEvaluated { settings ->
    settings.pluginManagement {
        repositories.clear()
        repositories {
            mavenLocal()
            maven {
                url 'http://私库地址/repository/gradle-distribution/'
				allowInsecureProtocol = true
            }
        }
    }
}

错误1

Exception is:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: ‘io.spring.nohttp’, version: ‘0.0.11’] was not found in any of the following sources:

image-20240122133629059

allprojects{
    repositories {
        mavenLocal()
        maven { url 'https://maven.aliyun.com/repository/public/' }
        maven { url 'https://maven.aliyun.com/repository/jcenter/' }
        maven { url 'https://maven.aliyun.com/repository/google/' }
        maven { 
			url 'http://私库地址/repository/gradle-distribution/'
			allowInsecureProtocol = true
		}
        maven { url 'https://jitpack.io/' }
    }
}
settingsEvaluated { settings ->
    settings.pluginManagement {
        repositories.clear()
        repositories {
            mavenLocal()
            maven {
                url 'http://私库地址/repository/gradle-distribution/'
				allowInsecureProtocol = true
            }
        }
    }
}

解决方式:maven仓库地址修改

allprojects{
    repositories {
        mavenLocal()
        maven { url 'https://maven.aliyun.com/repository/public/' }
        maven { url 'https://maven.aliyun.com/repository/jcenter/' }
        maven { url 'https://maven.aliyun.com/repository/google/' }
        maven { 
			url 'https://maven.aliyun.com/repository/gradle-plugin/'
		}
        maven { url 'https://jitpack.io/' }
    }
}
settingsEvaluated { settings ->
    settings.pluginManagement {
        repositories.clear()
        repositories {
            mavenLocal()
            maven {
                url 'https://maven.aliyun.com/repository/gradle-plugin/'
            }
        }
    }
}

问题1

gradle本地仓库已经下载了上面nohttp-0.0.11.jar依赖的jar包,再更换上面代理仓库地址时,还是会提示相关依赖找不到。

image-20240122134631116

构建完成之后,将init.gradle配置文件修改之前报错的,提示如下:

image-20240122135455855

image-20240122135343809

完成用时

image-20240122135012639