简体   繁体   English

构建失败 Spring 未找到引导插件

[英]Build failed Spring Boot Plugin was not found

I download a repo 'gs-handling-form-submission' from spring.io and now I'm trying to build: gradle build我从 spring.io 下载了一个 repo 'gs-handling-form-submission',现在我正在尝试构建: gradle build

Following Error has being triggered已触发跟随错误

 * Where:
Build file 'C:\Users\Username\Desktop\gs-handling-form-submission\complete\build.gradle' line: 11

* What went wrong:
Plugin [id: 'org.springframework.boot', version: '2.4.2'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.springframework.boot:org.springframework.boot.gradle.plugin:2.4.2')
  Searched in the following repositories:
    Gradle Central Plugin Repository

I already added a repo url, changed spring.boot version, added buildscript.repositories() at the first line, even doing that, I can't get to compile.我已经添加了一个 repo url,更改了 spring.boot 版本,在第一行添加了buildscript.repositories() ,即使这样做,我也无法编译。

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

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

repositories {
    jcenter()
    mavenCentral()
    maven {
        url: "https://plugins.gradle.org/m2/"
    }
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
    useJUnitPlatform()
}

Fixing the build.gradle , removing : url, was possible to build修复build.gradle ,删除: url,可以构建

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

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

repositories {
    jcenter()
    mavenCentral()
    maven {
        url 'https://plugins.gradle.org/m2/'
    }
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
    useJUnitPlatform()
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法应用插件[id'spring-boot'] - Failed to apply plugin [id 'spring-boot'] 找不到用于前缀“ spring-boot”的插件 - No plugin found for prefix 'spring-boot' QueryDSL 构建错误 AnnotationProcessor ' ' 未找到 Spring Boot - QueryDSL Build error AnnotationProcessor ' ' not found Spring Boot 在工作构建中找不到 Gradle/Spring Boot 包 - Gradle/Spring Boot packages are not found in working build 如何修复构建失败:无法在项目上执行目标 org.springframework.boot:spring-boot-maven-plugin:3.0.1:run (default-cli)? - How to fix build failure : Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.1:run (default-cli) on project? Maven-在当前项目中未找到前缀'spring-boot'的插件 - Maven- No plugin found for prefix 'spring-boot' in the current project 使用自定义名称构建 docker 映像 Spring Boot Maven 插件 - Build docker image with a custom name using Spring Boot Maven plugin 如何使用Maven插件正确构建Spring Boot far jar? - How to properly build a Spring Boot far jar using maven plugin? 找不到插件“org.springframework.boot:spring-boot-maven-plugin:” - Plugin 'org.springframework.boot:spring-boot-maven-plugin:' not found 在插件 org.springframework.boot:spring-boot-maven-plugin 中找不到目标“build-image”: - Could not find goal 'build-image' in plugin org.springframework.boot:spring-boot-maven-plugin:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM