
Requires Loaded 1.1.5 (or better). For Maven you can just add springloaded to the dependencies of the spring-boot plugin (and also set MAVEN_OPTS=-noverify). For Gradle add springloaded to the build dependencies (-noverify can be added by the plugin). In both cases there is also support for adding an arbitrary java agent via configuration. Samples are provided in spring-boot-sample-[simple,web-ui]. The ApplicationPlugin is only added if there is no JavaExec task already present, and additionally it computes its own man class if none is provided. So "gradle run" and "gradle bootRun" look superficially similar, but "bootRun" has extra options, including the agent and Loaded support. Fixes gh-251, gh-183
43 lines
1008 B
Groovy
43 lines
1008 B
Groovy
buildscript {
|
|
ext {
|
|
springBootVersion = '1.0.0.BUILD-SNAPSHOT'
|
|
springLoadedVersion = '1.1.5.RELEASE'
|
|
}
|
|
repositories {
|
|
mavenLocal()
|
|
maven { url "http://repo.springsource.org/libs-snapshot" }
|
|
}
|
|
dependencies {
|
|
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
|
|
classpath("org.springsource.loaded:springloaded:${springLoadedVersion}")
|
|
}
|
|
}
|
|
|
|
|
|
apply plugin: 'java'
|
|
apply plugin: 'eclipse'
|
|
apply plugin: 'idea'
|
|
apply plugin: 'spring-boot'
|
|
|
|
mainClassName = "sample.ui.SampleWebUiApplication"
|
|
|
|
jar {
|
|
baseName = 'spring-boot-sample-simple'
|
|
version = '0.5.0'
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url "http://repo.springsource.org/libs-snapshot" }
|
|
}
|
|
|
|
dependencies {
|
|
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
|
|
compile("org.hibernate:hibernate-validator")
|
|
testCompile("org.springframework.boot:spring-boot-starter-test")
|
|
}
|
|
|
|
task wrapper(type: Wrapper) {
|
|
gradleVersion = '1.6'
|
|
}
|