spring-boot - 找不到Spring Boot插件

标签 spring-boot gradle intellij-idea

我对gradle项目有问题

我的build.gradle

buildscript {
    ext {
        springBootVersion = '2.1.8.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath(
                "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

plugins {
    id 'org.springframework.boot' version '2.1.8.RELEASE'
}

apply plugin: 'org.springframework.boot'

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

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    runtimeOnly 'mysql:mysql-connector-java'
    providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'org.springframework.security:spring-security-test'
}

当我尝试运行build.gralde时,出现错误
Plugin [id: 'org.springframework.boot', version: '2.1.8.RELEASE'] was not found in any of the following sources:

IDEA中的Gradle首选项

enter image description here

我不明白,这是什么问题,我已经用Spring Initializer生成了项目

最佳答案

我想,我有问题。
您只需要关闭“离线模式”,它将从仓库中下载
enter image description here

在Intellij IDEA的右侧

关于spring-boot - 找不到Spring Boot插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58187106/

相关文章:

android - intellij IDEA - 创建Android应用程序失败

java - 太多重定向_OKTA 身份验证

java - 无法获取 org.gradle.api.Project 类型的项目 'VERSION_CODE' 的未知属性 ':app'

gradle - GOCD-我们可以为gradle/gradlew任务运行一个工作目录吗

java - 在 IntelliJ 中添加您自己的自定义宏,例如 "sout"

plugins - 如何在 IntelliJ 中将插件下载到磁盘以进行离线安装

java - Jackson - 动态添加枚举值时 EnumValues 序列化失败

postgresql - hibernate LocalDateTime : Postgresql schema generation creates columns of type "bytea" in external Tomcat

mysql - 无法使用 Spring Boot 连接 mysql

groovy - 无法使用 groovy 注释中的类中定义的变量