while working with shadow plugin I tried to execute my Gradle code:
import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer
shadow {
transformer(AppendingTransformer) {
resource = 'META-INF/spring.handlers'
}
transformer(AppendingTransformer) {
resource = 'META-INF/spring.schemas'
}
}
As a result i received the folloqing error:
Could not find method transformer() for arguments [class com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer, build_bdpgdpxcevq273h2385je07ue$_run_closure2_closure5@1452aad2] on project ':ProjectX'.
Am i missing something? where does the 'transformer' function should be defined?
Your question lack some information, but from the error you pasted it looks like the shadow extension does not really contain a transformer method (thus trying to find it on the owner object - project). To me it means that you are probably using one of the latest (latest being the 1.2.2 version) versions of the shadow plugin whilst trying to configure it in some old not-supported way.
In the newer versions you should configure the plugin via the
shadowJar {
transform(AppendingTransformer) {
resource = 'NOTICE'
}
}
Configuration closure and not the old notiation
shadow {}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments