spring-boot gradle plugin can't be found

前端 未结 8 1236
醉话见心
醉话见心 2021-02-05 02:44

I have a separate gradle script that is just adding spring-boot plugin. It looks like this:

buildscript {
    repositories {
        mavenLocal()
        mavenCe         


        
8条回答
  •  情书的邮戳
    2021-02-05 02:53

    These are the Plugins that I am using on spring boot 2.0.1

    apply plugin: 'java'
    apply plugin: 'org.springframework.boot'
    apply plugin: 'io.spring.dependency-management'
    

    My complete vanilla gradle file here (Spring boot 2.0.5)

    buildscript {
        ext {
            springBootVersion = '2.0.5.RELEASE'
        }
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        }
    }
    
    apply plugin: 'java'
    apply plugin: 'org.springframework.boot'
    apply plugin: 'io.spring.dependency-management'
    
    group = 'com.example'
    version = '0.0.1-SNAPSHOT'
    sourceCompatibility = 1.8
    
    repositories {
        mavenCentral()
    }
    
    
    dependencies {
        compile('org.springframework.boot:spring-boot-starter')
        testCompile('org.springframework.boot:spring-boot-starter-test')
    }
    

    OR

    there is an even better option, go to the spring starter (spring boot template generating tool) start.spring.io And generate a template project from there, and build step-by-step from there.

提交回复
热议问题