当前位置: 首页 > 知识库问答 >
问题:

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

刁冠宇
2023-03-14

我得到了一些错误:

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

    null
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
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

配置项目':Gisett-Backend'时出现问题。

无法解析配置“:gisett-backend:classpath”的所有工件。找不到io.spring.gradle:propdeps-plugin:0.0.9.发行版。在以下位置搜索:-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.pom-https://repo.spring.io/snapshot/io/spring/propdeps-plugin/0.0.9.release.pom

这是Build.Gradle的部分:


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" }
}



}

//...


我该怎么修好它?谢谢

共有1个答案

钱元徽
2023-03-14

尝试更改您的构建。Gradle应该如下所示:

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'
 类似资料:
  • 项目生成错误:不可解析的父POM:无法传输org.springframework.boot:spring-boot-parent:POM:1.2.3.来自http://central.maven.org/maven2/的版本已缓存在本地存储库中,在central的更新间隔已过或强制更新之前,将不会重新尝试解析。原始错误:无法传输项目org.springframework.boot:spring-b

  • 我想在谷歌应用引擎上部署我的Spring应用程序,但我收到了这条错误消息: 谷歌云sdk和应用程序引擎工具已经安装在我的笔记本电脑上。 我在互联网上搜索,发现我必须将项目ID放入gradle文件中: 但问题是gradle不能重新分配所有这些属性。 我的gradle文件有什么问题导致了这个问题吗?

  • 这是我的pom.xml 此行导致问题。 项目生成错误:com.skm:myapps:0.0.1-快照:无法解析org.springframework.boot:spring-boot-starter-parent:POM:2.0.2。来自https://repo.maven.apache.org/maven2的版本缓存在本地存储库中,在central的更新间隔已过或强制更新之前,不会重新尝试解析。

  • 驴你看,我要添加截取到我的应用程序添加这行代码com.mcxioke。截取:库aar:1.0.0建立。gradle文件 我也试着添加改装。但它给出了相同类型的错误:未能解决:bla bla bla。 所以我认为在我的情况下gradle不能同步任何其他库不同于com.android....... 我也尝试将这行代码添加到我的build.gradle。但是什么都没有改变 请指教 编辑:添加注释后生成。

  • 我已经使用以下Github存储库设置了Spring boot工作区:https://Github.com/leanstacks/spring-boot-fundaments/tree/repository 非常感谢任何建议/反馈。

  • 问题内容: 这是我的 pom.xml 这条线引起问题。 项目构建错误:com.skm:MyApps:0.0.1-SNAPSHOT的不可解析的父POM:无法从https:/转移org.springframework.boot:spring- boot-starter-parent:pom:2.0.2.RELEASE /repo.maven.apache.org/maven2已缓存在本地存储库中,直到