beryx / badass-runtime-plugin

Create a custom runtime image of your non-modular application
https://badass-runtime-plugin.beryx.org
Apache License 2.0
161 stars 21 forks source link

Uses deprecated field mainClassName #115

Closed satsen closed 1 year ago

satsen commented 2 years ago

mainClassName is removed in Gradle 8.0. mainClass (application.mainClass) should be used instead or this plugin will stop working.

louhy commented 2 years 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.

satsen commented 2 years ago

@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.

louhy commented 2 years ago

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.

satsen commented 2 years ago

@louhy Unfortunately, it won't be checked out.

hakanai commented 2 years ago

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.

satsen commented 1 year ago

@hakanai This plugin is effectively dead, I moved on to a custom setup with using SPI ToolProvider and calling jdeps & jlink from there.

hakanai commented 1 year ago

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.