'setter for mainClassName: String' is deprecated. Deprecated in Java

Any of the below 3 should work:

springBoot {
    mainClass.set('package.class')
}

bootJar {
    mainClass.set('package.class')
}

application {
    mainClass.set('package.class')
}

for spring boot project

springBoot {
  mainClass.set("your.full.classname")
}

Setting mainClassName on the top level should work too:

mainClassName = "io.vertx.core.Launcher"

https://github.com/AlexeySoshin/KotlinWebDevelopment/blob/20-testing-graphql-api/build.gradle#L14


It seems the latest way of doing this is:

application {
    mainClass.set(launcherClassName)
}