Skip to content

Bootstrap plugin can not be used with the latest Gradle v6.5.x #61

@yuri-sergiichuk

Description

@yuri-sergiichuk

If one uses e.g. Gradle v6.5.1 with the latest Bootstrap v1.5.24 plugin, the following compilation error is raised:

java.lang.ClassFormatError: Duplicate method name "$deserializeLambda$" with signature "(Ljava.lang.invoke.SerializedLambda;)Ljava.lang.Object;" in class file io/spine/tools/gradle
/protoc/ProtobufGenerator
        at io.spine.tools.gradle.bootstrap.Extension$Builder.setProject(Extension.java:290)
        at io.spine.tools.gradle.bootstrap.BootstrapPlugin.applyExtension(BootstrapPlugin.java:80)
        at io.spine.tools.gradle.bootstrap.BootstrapPlugin.apply(BootstrapPlugin.java:69)
        at io.spine.tools.gradle.bootstrap.BootstrapPlugin.apply(BootstrapPlugin.java:64)
        at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:43)
        at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:51)
        at org.gradle.api.internal.plugins.DefaultPluginManager.addPlugin(DefaultPluginManager.java:181)
        at org.gradle.api.internal.plugins.DefaultPluginManager.access$300(DefaultPluginManager.java:51)
        at org.gradle.api.internal.plugins.DefaultPluginManager$AddPluginBuildOperation.run(DefaultPluginManager.java:276)

The issue is related to one raised by @dmdashenkov in the Gradle repository: gradle/gradle#13325. As Dmitry described in the issue, looks like Gradle instruments the code in some interesting way and most probably instruments it for Kotlin. We have an example project that works perfectly fine when the build configuration is done with Groovy.

As a possible solution, maybe we can try to fix the issue by using inner classes instead of lambdas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions