Spring 无法将插件DSL与构建脚本块组合
我对Spring Boot和Gradle都是新手。在试图简化build.gradle脚本时,我遇到了以下问题。因为我使用的是Gradle2.5,所以我决定利用Gradle的新插件DSL。不幸的是,我需要使用的一个插件,Spring 无法将插件DSL与构建脚本块组合,spring,gradle,spring-boot,gradle-plugin,Spring,Gradle,Spring Boot,Gradle Plugin,我对Spring Boot和Gradle都是新手。在试图简化build.gradle脚本时,我遇到了以下问题。因为我使用的是Gradle2.5,所以我决定利用Gradle的新插件DSL。不幸的是,我需要使用的一个插件,spring-boot-gradle-plugin,没有包含在gradle-plugins门户中。为了解决这个问题,我为这个插件使用了旧的buildscript{…},apply plugin:语法,并在新的plugins{…}语法中指定了我的其余插件。结果是生成以下生成脚本: b
spring-boot-gradle-plugin
,没有包含在gradle-plugins门户中。为了解决这个问题,我为这个插件使用了旧的buildscript{…}
,apply plugin:
语法,并在新的plugins{…}
语法中指定了我的其余插件。结果是生成以下生成脚本:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath: "org.springframework.boot:spring-boot-gradle-plugin:1.3.2.RELEASE"
}
}
plugins {
id "io.spring.dependency-management" version "0.5.4.RELEASE"
id "java"
id "idea"
}
apply plugin: 'spring-boot'
repositories {
mavenCentral()
}
dependencyManagement {
imports {
mavenBom 'com.vaadin:vaadin-bom:7.6.1'
}
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("org.springframework.boot:spring-boot-starter-actuator")
compile("com.vaadin:vaadin-spring-boot-starter")
compile("com.h2database:h2")
testCompile("junit:junit")
}
jar {
baseName = 'my-spring-boot-app'
version = '0.1.0'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
但是,此生成脚本不起作用。当运行
gradlebuild
时,我得到了一个错误插件,id为'spring boot',找不到。
这是试图将这两个语法结合使用的结果,还是我只是做了一些傻事?我很傻。第6行出现语法错误。类路径之后不应该有冒号