Home > database >  Specifying plugin class in bytebuddy gradle plugin
Specifying plugin class in bytebuddy gradle plugin

Time:09-28

I have updated ByteBuddy Gradle plugin to the version 1.11.18.

Unlikely the previous version, where I could set up byteBuddy.transform.plugin as a string, in the latest version I have to set it up as a class.

Cannot cast object 'com.test.PluginImpl.class' with class 'java.lang.String' to class 'java.lang.Class' due to: java.lang.ClassNotFoundException: com.test.PluginImpl.class

I'm trying to figure out how to get the plugin applied

I followed the readme (https://github.com/raphw/byte-buddy/tree/master/byte-buddy-gradle-plugin#buildgradle):

byteBuddy {
    transformation {
        plugin = com.test.PluginImpl.class
    }
}

However, I've got the error:

* What went wrong:
A problem occurred evaluating root project 'Test'.
> Could not get unknown property 'com' for object of type net.bytebuddy.build.gradle.Transformation.

CodePudding user response:

Did you add the plugin to the buildsource? Groovy is a bit guessy when it comes to these things. Also try importing the class and using the unqualified name.

The old approach did no longer work properly with newer Gradle versions which is why I had to redo it.

  • Related