找不到参数的方法pluginManagement()

时间:2019-07-02 09:16:49

标签: java spring spring-boot gradle

在使用gradle构建Spring Boot项目时,我面临以下问题

出了什么问题: 评估设置“ ConfigurationManager”时出现问题。

  

在类型为org.gradle.initialization.DefaultSettings的设置'ConfigurationManager'上找不到参数[settings_4czoxeapfgxghi54ogzhrlgs9 $ _run_closure1 @ 6e5e4ee]的方法pluginManagement()。

settings.gradle的内容如下

pluginManagement {
    repositories {
        gradlePluginPortal()
    }
}
rootProject.name = 'ConfigurationManager'

gradle-wrapper.properties的内容如下

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

build.gradle的内容如下

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

apply plugin: 'io.spring.dependency-management'

group = 'demo.comp.dept'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

configurations {
    developmentOnly
    runtimeClasspath {
        extendsFrom developmentOnly
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-data-ldap'
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'org.springframework.security:spring-security-test'
}

0 个答案:

没有答案