- OS: macOS Catalina
- 源代码地址:https://github.com/spring-projects/spring-framework/tree/4.1.x
- 源代码分支:4.1.x
- 源代码下载到本地后,根据文档 https://github.com/spring-projects/spring-framework/blob/4.1.x/import-into-idea.md 执行命令:./gradlew cleanIdea :spring-oxm:compileTestJava,报错如下:
$ ./gradlew cleanIdea :spring-oxm:compileTestJava
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'spring'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve org.springframework.build.gradle:propdeps-plugin:0.0.7.
Required by:
:spring:4.1.10.BUILD-SNAPSHOT
> Could not GET 'https://repo.spring.io/plugins-release/org/springframework/build/gradle/propdeps-plugin/0.0.7/propdeps-plugin-0.0.7.pom'. Received status code 401 from server:
> Could not resolve org.asciidoctor:asciidoctor-gradle-plugin:0.7.0.
Required by:
:spring:4.1.10.BUILD-SNAPSHOT
> Could not HEAD 'https://repo.spring.io/plugins-release/org/asciidoctor/asciidoctor-gradle-plugin/0.7.0/asciidoctor-gradle-plugin-0.7.0.pom'. Received status code 401 from server:
> Could not resolve io.spring.gradle:docbook-reference-plugin:0.3.1.
Required by:
:spring:4.1.10.BUILD-SNAPSHOT
> Could not GET 'https://repo.spring.io/plugins-release/io/spring/gradle/docbook-reference-plugin/0.3.1/docbook-reference-plugin-0.3.1.pom'. Received status code 401 from server:
> Could not resolve ws.antonov.gradle.plugins:gradle-plugin-protobuf:0.9.1.
Required by:
:spring:4.1.10.BUILD-SNAPSHOT
> Could not HEAD 'https://repo.spring.io/plugins-release/ws/antonov/gradle/plugins/gradle-plugin-protobuf/0.9.1/gradle-plugin-protobuf-0.9.1.pom'. Received status code 401 from server:
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 11.139 secs
- 看报错信息,大概明白从 https://repo.spring.io 下载依赖需要用户名、密码等认证信息。我应该怎么修改构建配置文件呢?
spring源码编译问题解决1,Received status code 401 from server问题,not found问题,更换阿里云镜像
https://blog.csdn.net/tazuxianzai/article/details/118809722