how do i configure the shadow plugin using kotlin dsl?

The problem was that I tried to add mainClassName to the ShadowJar task, it should have been added to the application function. Like this:

application {
    val name = "com.cognite.ingestionservice.MainKt"

    // Required by ShadowJar.
    mainClassName = name

The mainClassName property is deprecated, but is still required by ShadowJar as of version 6.1.0.

mainClass.set() is not necessary when adding mainClassName, but it was in the documentation for gradle 6.7, so I added it anyway.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top