首页
学习
活动
专区
圈层
工具
发布

springboot gradle 使用过程中遇到的问题小结(2)

想要打包api层,然后出现错误:

Plugin request for plugin already on the classpath must not include a version

新建的项目中默认的build.gradle中是:

代码语言:javascript
复制
id 'org.springframework.boot' version '2.1.6.RELEASE'

可以修改为:

代码语言:javascript
复制
buildscript {
    ext {
        springBootVersion = '2.1.6.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

plugins {
//    id 'org.springframework.boot' version '2.1.6.RELEASE'
    id 'java'
}

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

即可解决问题

下一篇
举报
领券