Plugin jar signed by jarsigner

I found that it is probably not possible to sign own Gradle plugin by jarsigner.
Because when I did it this plugin cause this crash

class "com.mycompany.gradle.buildplugin.PluginExtension_Decorated"'s signer information does not match signer information of other classes in the same package

If I understand it. JVM itself prevent to have classes signed by different signature in the same package. And also signed and unsigned one in the same package. So JVM itself doesn’t allow Gradle to dynamically create a new class in the same package.

It is the behavior of JVM and the only possible solution is that Gradle will stop creating _Decorated classes at runtime, which is not possible. So the only solution is not to sign Gradle plugins by jarsigner at all.