Плагин Spring Boot не найден - PullRequest
1 голос
/ 01 октября 2019

У меня проблема с 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:

Настройки Gradle в IDEA

enter image description here

Не могу понять, в чем проблема, я сгенерировал проект с помощью Spring Initializer

Ответы [ 2 ]

2 голосов
/ 01 октября 2019

Я думаю, у меня проблема. Вам просто нужно отключить «Автономный режим», и он загрузит его из репозитория enter image description here

Он находится в правой части Intellij IDEA

1 голос
/ 02 октября 2019

Возможное объяснение состоит в том, что при явной настройке buildscript.repositories у вас больше нет значения по умолчанию gradlePluginPortal(). Например, не все плагины доступны в Maven Central.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...