I\'m trying to set up gradle to launch the bootRun
process with various spring profiles enabled.
My current bootRun
configuration looks lik
For those folks using Spring Boot 2.0+, you can use the following to setup a task that will run the app with a given set of profiles.
task bootRunDev(type: org.springframework.boot.gradle.tasks.run.BootRun, dependsOn: 'build') {
group = 'Application'
doFirst() {
main = bootJar.mainClassName
classpath = sourceSets.main.runtimeClasspath
systemProperty 'spring.profiles.active', 'dev'
}
}
Then you can simply run ./gradlew bootRunDev
or similar from your IDE.