In a multi-project setup, to generate a Fat Jar, the main class in the main project is set like this:
application {
mainClass.set("$group.ApplicationKt")
}
But for the child sub-projects, I had to set the main class to empty:
application {
mainClass.set("")
}
If I don't do this, I encounter an exception when running the buildFatJar task:
Execution failed for task ':kcrud-employment:shadowJar'.
Error while evaluating property 'mainClassName' of task ':kcrud-employment:shadowJar'.
Cannot query the value of extension 'application' property 'mainClass' because it has no value available.
Is it expected behavior to explicitly set the mainClass to empty for sub-projects? I assumed this would be implicitly detected by the Gradle task.