首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Gradle无法解决org.springframework.boot:spring-boot-dependencies:

Gradle无法解决org.springframework.boot:spring-boot-dependencies:
EN

Stack Overflow用户
提问于 2021-02-15 11:11:21
回答 1查看 1.9K关注 0票数 0

我犯了一些错误:

失败:生成失败,出现异常。

  • 到底出了什么问题:

代码语言:javascript
复制
Execution failed for task ':gisett-backend:compileJava'.
> Could not resolve all dependencies for configuration ':gisett-backend:detachedConfiguration1'.
  > Could not resolve org.springframework.boot:spring-boot-dependencies:2.0.3.RELEASE.
    Required by:
        project :gisett-backend
     > Could not resolve org.springframework.boot:spring-boot-dependencies:2.0.3.RELEASE.
        > Could not get resource 'http://repo.boundlessgeo.com/main/org/springframework/boot/spring-boot-dependencies/2.0.3.RELEASE/spring-boot-dependencies-2.0.3.RELEASE.pom'.
           > Could not HEAD 'http://repo.boundlessgeo.com/main/org/springframework/boot/spring-boot-dependencies/2.0.3.RELEASE/spring-boot-dependencies-2.0.3.RELEASE.pom'.
              > No such host is known (repo.boundlessgeo.com)
     > Could not resolve org.springframework.boot:spring-boot-dependencies:2.0.3.RELEASE.
        > Could not get resource 'http://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-dependencies/2.0.3.RELEASE/spring-boot-dependencies-2.0.3.RELEASE.pom'.
           > Could not HEAD 'http://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-dependencies/2.0.3.RELEASE/spring-boot-dependencies-2.0.3.RELEASE.pom'. Received status code 501 from server: HTTPS Required

我怎么才能修好它?

更新:

它有部分帮助,现在我明白了:

代码语言:javascript
复制
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':gisett-backend'.
> Could not resolve all artifacts for configuration ':gisett-backend:classpath'.
  > Could not resolve io.spring.gradle:propdeps-plugin:0.0.9.RELEASE.
    Required by:
        project :gisett-backend
     > Could not resolve io.spring.gradle:propdeps-plugin:0.0.9.RELEASE.
        > Could not get resource 'https://repo.spring.io/libs-snapshot/io/spring/gradle/propdeps-plugin/0.0.9.RELEASE/propdeps-plugin-0.0.9.RELEASE.pom'.
           > Could not HEAD 'https://repo.spring.io/libs-snapshot/io/spring/gradle/propdeps-plugin/0.0.9.RELEASE/propdeps-plugin-0.0.9.RELEASE.pom'. Received status code 401 from server: Unauthorized

更新2:修复了它(我更新了服务器列表),但现在又出现了另一个错误:

配置项目‘:gisett-后端’出现了问题。

无法解析配置的所有工件‘:gisett-后端:classpath’。无法在以下位置找到搜索的io.spring.gradle:propdeps-plugin:0.0.9.RELEASE.:- https://repo.maven.apache.org/maven2/io/spring/gradle/propdeps-plugin/0.0.9.RELEASE/propdeps-plugin-0.0.9.RELEASE.pom - https://repo.spring.io/snapshot/io/spring/gradle/propdeps-plugin/0.0.9.RELEASE/propdeps-plugin-0.0.9.RELEASE.pom - https://plugins.gradle.org/m2/io/spring/gradle/propdeps-plugin/0.0.9.RELEASE/propdeps-plugin-0.0.9.RELEASE.pom

这是build.gradle的一部分:

代码语言:javascript
复制
buildscript {


    ext {
        springBootVersion = '2.0.1.BUILD-SNAPSHOT'
    }
    repositories {
        mavenCentral()
        maven { url 'https://repo.spring.io/snapshot/' }
        maven { url "https://plugins.gradle.org/m2/" }
        //for finding propdeps-plugin dependency

    }
    dependencies {
        classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
        classpath "com.moowork.gradle:gradle-node-plugin:1.2.0"

       // classpath 'io.spring.gradle:propdeps-plugin:0.0.9.RELEASE'

    }

}



//...


// In this section you declare where to find the dependencies of your project
repositories {
    maven { url "https://repo.spring.io/plugins-release" }
//...

    maven { url "https://repo.maven.apache.org/maven2" }
}



}

//...

我怎么才能修好它?谢谢

EN

回答 1

Stack Overflow用户

发布于 2021-02-15 11:24:23

尝试更改您的build.gradle应该如下所示:

代码语言:javascript
复制
buildscript {
    ext {
        springBootVersion = '2.0.3.BUILD-SNAPSHOT'
    }
    repositories {
        mavenCentral()
        maven { url 'https://repo.spring.io/libs-snapshot' }
    }
    dependencies {
        classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
    }
}

apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66206973

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档