首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到Spring Boot插件

找不到Spring Boot插件
EN

Stack Overflow用户
提问于 2019-10-01 22:33:44
回答 2查看 1.7K关注 0票数 1

我对gradle项目有一个问题

我的build.gradle

代码语言:javascript
复制
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时,我得到了错误

代码语言:javascript
复制
Plugin [id: 'org.springframework.boot', version: '2.1.8.RELEASE'] was not found in any of the following sources:

IDEA中的Gradle首选项

我不明白,有什么问题,我用Spring Initializer生成了项目

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-10-01 23:05:24

我想,我有问题了。你只需要关闭“离线模式”,它就会从repo下载。

它在Intellij想法的右边

票数 1
EN

Stack Overflow用户

发布于 2019-10-02 19:45:33

一种可能的解释是,通过显式配置buildscript.repositories,您不再拥有默认的gradlePluginPortal()。例如,并非所有插件在Maven Central上都可用。

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

https://stackoverflow.com/questions/58187106

复制
相关文章

相似问题

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