在以下任何来源中均未找到插件[id:'org.springframework.boot',版本:'2.1.7.RELEASE']

时间:2019-08-17 08:05:42

标签: java spring spring-boot gradle

我最近开始使用gradle并尝试在我的mac机中使用gradle运行spring boot应用程序。

当我尝试进行本地构建时,出现以下错误:

enter image description here

我的build.gradle是从spring initializr下载的默认文件,几乎没有依赖项。

plugins {
id 'org.springframework.boot' version '2.1.7.RELEASE'
id 'io.spring.dependency-management' version '1.0.7.RELEASE'
id 'java'
}

group = 'com.ank'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

repositories {
 maven {
    url "https://plugins.gradle.org/m2/"
 }
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
}

我的JAVA_HOME位于路径/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home

我尝试通过gradle --stacktrace在Intellij,Eclipse和终端中构建相同的对象。它在任何地方都失败,并显示相同的错误。

我的gradle版本是5.6。

1 个答案:

答案 0 :(得分:1)

添加以下存储库。 org.springframework.boot:org.springframework.boot.gradle.plugin在Maven Central中不可用:

repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }