首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >intellij同步错误:“无法解析配置的所有工件‘:类路径’”。

intellij同步错误:“无法解析配置的所有工件‘:类路径’”。
EN

Stack Overflow用户
提问于 2021-08-25 07:08:00
回答 1查看 2.8K关注 0票数 1

这是我的build.gradle

代码语言:javascript
复制
buildscript {
    ext {
        springBootVersion = '2.1.7.REALEASE'
    }
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter-web:')
    testCompile('org.springframework.boot:spring-boot-starter-test:')
}

这是同步ErrorMessage

无法解析配置的所有工件“:类路径”。无法找到在以下位置搜索到的org.springframework.boot:spring-boot-gradle-plugin:2.1.7.REALEASE.:- https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/2.1.7.REALEASE/spring-boot-gradle-plugin-2.1.7.REALEASE.pom - https://jcenter.bintray.com/org/springframework/boot/spring-boot-gradle-plugin/2.1.7.REALEASE/spring-boot-gradle-plugin-2.1.7.REALEASE.pom (项目:可能的解决方案)所需:

提供工件的

  • 声明存储库,请参阅的文档

有明确声明的存储库,如mavenCentral()和jcnenter(),但无法构建。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-09-01 02:16:59

我被告知jcenter不再被服务,所以我更改了依赖项并删除了jcenter()。

此构建已成功运行。

代码语言:javascript
复制
buildscript {
    ext{
        springBootVersion = '2.1.7.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}

test {
    useJUnitPlatform()
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68918326

复制
相关文章

相似问题

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