Use mainClass rather than deprecated main in BootRun examples

Closes gh-29965
This commit is contained in:
Andy Wilkinson 2022-02-23 08:58:22 +00:00
parent ee7426a555
commit 9c9e04b8e4
2 changed files with 4 additions and 4 deletions

View File

@ -5,12 +5,12 @@ plugins {
// tag::main[]
bootRun {
main = 'com.example.ExampleApplication'
mainClass = 'com.example.ExampleApplication'
}
// end::main[]
task configuredMainClass {
doLast {
println bootRun.main
println bootRun.mainClass
}
}

View File

@ -7,12 +7,12 @@ plugins {
// tag::main[]
tasks.getByName<BootRun>("bootRun") {
main = "com.example.ExampleApplication"
mainClass.set("com.example.ExampleApplication")
}
// end::main[]
task("configuredMainClass") {
doLast {
println(tasks.getByName<BootRun>("bootRun").main)
println(tasks.getByName<BootRun>("bootRun").mainClass)
}
}