【发布时间】:2015-03-11 13:31:19
【问题描述】:
使用 Spring Boot 和 Gradle 时,依赖项闭包中有一些 cmets,例如“tag::jetty[]”和“end::jetty[]”。鉴于它们的语法,我假设它们是由诸如 spring boot gradle 插件之类的东西解析的。这些有什么作用?他们是否需要让弹簧靴执行器和嵌入式码头工作?
来自下面docs 的示例(请参阅依赖项关闭):
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.10.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
jar {
baseName = 'gs-spring-boot'
version = '0.1.0'
}
repositories {
mavenCentral()
}
dependencies {
// tag::jetty[]
compile("org.springframework.boot:spring-boot-starter-web") {
exclude module: "spring-boot-starter-tomcat"
}
compile("org.springframework.boot:spring-boot-starter-jetty")
// end::jetty[]
// tag::actuator[]
compile("org.springframework.boot:spring-boot-starter-actuator")
// end::actuator[]
testCompile("junit:junit")
}
task wrapper(type: Wrapper) {
gradleVersion = '1.11'
}
【问题讨论】:
标签: gradle spring-boot