Update - September 8th, 2017
In newer versions of the Kotlin support, you have a couple other more idiomatic ways to accomplish this:
tasks {
"bootRepackage"(Repackage::class) {
mainClass = "demo.Application"
}
}
And also:
val bootRepackage by tasks.getting(Repackage::class) {
mainClass = "demo.Application"
}
I'm sure the task will change in a new version of Spring Boot.
bootRepackage
is a task of type org.springframework.boot.gradle.repackage.RepackageTask
. With 0.4.1
, there are no extension methods available to make this configuration obvious. You will have to do something like the following:
import org.springframework.boot.gradle.repackage.RepackageTask
(tasks.getByName("bootRepackage") as RepackageTask).apply {
mainClass = "demo.Application"
}
Relevant open issues for Task
configuration: