Hi,
I am poring my application from Maven to Gradle. It uses Hibernate and needs
to perform class instrumentation of certain classes. All works well except
that it seems that Gradle is pushing it's own asm (asm-3.2) version totally
disregarding the one that Hibernate depends upon (asm-1.5.3). It looks as if
the separation of classloaders for the ant tasks in Gradle does not work
well.
Output from gradle instrument command.
* What went wrong:
Execution failed for task ':instrument'.
Cause: java.lang.NoSuchMethodError:
org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVis
itor;Z)V
Can anybody point me to some workaround? I really like Gradle, and would not
want to go back to Maven.
Interesting lines from my build.gradle:
dependencies {
hibInstrument "org.hibernate:hibernate:3.2.6.ga"
......
}
task instrument(dependsOn: compileJava) << {
ant.taskdef(name: 'hibInstrument',
classname: 'org.hibernate.tool.instrument.cglib.InstrumentTask',
classpath: configurations.hibInstrument.asPath)
ant.hibInstrument(verbose: 'true'){
fileset(dir:"$buildDir/classes/main/com/seriouscorp/fcc/domain"){
include(name: "TestCaseResult.class")
}
}
}