赞
踩
构建过两次spring的源码,第一次很顺利就完成了,第二次倒是遇到了不少问题。记录一下
需要注意的几点:
gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
id 'com.gradle.build-scan' version '3.2'
这个插件无法下载Build file 'F:\idea_code\enjoy\spring源码相关\spring-source-5.2.8\build.gradle' line: 6
Error resolving plugin [id: 'io.spring.gradle-enterprise-conventions', version: '0.0.2']
> Could not resolve all dependencies for configuration 'detachedConfiguration5'.
> Could not determine artifacts for io.spring.gradle-enterprise-conventions:io.spring.gradle-enterprise-conventions.gradle.plugin:0.0.2
> Could not get resource 'https://repo.spring.io/plugins-release/io/spring/gradle-enterprise-conventions/io.spring.gradle-enterprise-conventions.gradle.plugin/0.0.2/io.spring.gradle-enterprise-conventions.gradle.plugin-0.0.2.jar'.
> Could not HEAD 'https://repo.spring.io/plugins-release/io/spring/gradle-enterprise-conventions/io.spring.gradle-enterprise-conventions.gradle.plugin/0.0.2/io.spring.gradle-enterprise-conventions.gradle.plugin-0.0.2.jar'. Received status code 401 from server: Unauthorized
不知道什么时候开始,从spring的官网仓库下载包或插件需要认证了,这里很明显的一个灭有授权的错误401,但是此时我的build.gradle以及setting.gradle是这样配置的:
repositories {
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}
mavenCentral()
jcenter()
google()
maven { url "https://repo.spring.io/libs-spring-framework-build" }
}
repositories {
gradlePluginPortal()
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://repo.spring.io/plugins-release' }
}
我已经加了阿里云的源,但似乎不起作用,还是首先去spring官网去加载,于是我只好先把spring的源注释掉,只保留阿里云的。这样开始下一步执行gradlew :spring-oxm:compileTestJava
先编译spring-oxm模块。编译成功之后,再导入到idea中点击build做全局编译。
plugins {
id 'io.spring.dependency-management' version '1.0.8.RELEASE' apply false
id 'org.jetbrains.kotlin.jvm' version '1.3.72' apply false
id 'org.jetbrains.dokka' version '0.10.1' apply false
id 'org.asciidoctor.jvm.convert' version '2.4.0'
// id 'io.spring.gradle-enterprise-conventions' version '0.0.2'
id 'io.spring.nohttp' version '0.0.5.RELEASE'
id 'de.undercouch.download' version '4.0.0'
id 'com.gradle.build-scan' version '3.2'
id "com.jfrog.artifactory" version '4.12.0' apply false
id "io.freefair.aspectj" version '4.1.1' apply false
id "com.github.ben-manes.versions" version '0.24.0'
}
就是注释掉的那个id ‘io.spring.gradle-enterprise-conventions’ version ‘0.0.2’,可以先注释掉
plugin with id ‘java-test-fixtures‘ not found
gradle版本要求在5.6.4-6.0之间
这时候大部分模块都编译好了,只剩下一个spring-tx包,它依赖了一个包我这里找不到资源,
Could not find com.ibm.websphere:uow:6.0.2.17.
Required by:
project :spring-tx
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
这时候可以再把前面注释掉的spring官网的源给放开,就下载下来了。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。