Closed satsen closed 1 year ago
@satsen Not sure this is an issue with this plugin -
I was getting the same, but it only happens when I also include the com.github.johnrengelman.shadow plugin. Everything (that I'm doing) works fine without explicitly including the Shadow plugin, so... Do you include the Shadow plugin in your gradle.build? (And if you are, do you need to?)
BTW Digging further, BRP has this code inside RuntimeTask.groovy (note the comment):
// workaround for shadow bug https://github.com/johnrengelman/shadow/issues/572
if(GradleVersion.current() >= GradleVersion.version('6.4')) {
if(!startScriptTask.mainClass.present) {
startScriptTask.mainClass.set(startScriptTask.mainClassName)
}
}
That Shadow issue is closed now, so maybe this workaround can be removed.
@louhy This plugin has special features for when shadow is present. And it was some time ago but I remember reading mainClassName in the source code of this plugin.
Got it - well, in any case, whenever this is looked at that, bit of groovy I pasted above should probably be checked out as well.
@louhy Unfortunately, it won't be checked out.
When I investigated, I found the same workaround in RuntimeTask.groovy
mentioned previously. It seems like this workaround shouldn't be performed if the Gradle version is 7.0+, so I added an additional condition in there. There's a lot of Gradle version conditional code in this plugin which makes maintenance fiddly already and will probably only get worse with time.
@hakanai This plugin is effectively dead, I moved on to a custom setup with using SPI ToolProvider and calling jdeps & jlink from there.
We'll probably move to some other plugin based on jpackage, but we're currently back on a JDK which doesn't have it yet.
mainClassName is removed in Gradle 8.0. mainClass (application.mainClass) should be used instead or this plugin will stop working.