I need a way to deal with classpath conflicts when running Groovy based unit tests from IDEA. Basically my problem results from a conflict between the asm-2.2.jar included in Groovy and the asm-1.5.3.jar needed by our project. IDEA puts all the groovy jars first in the classpath thus using the asm-2.2.jar in our code. There was an incompatible change made to the call list of the method org.objectweb.asm.ClassVistor which breaks Spring.
I can run these tests from the command line using Maven 1 or 2 because Maven is configured to use the groovy-all-1.5.0.jar which is designed to be embeddable to precisely avoid these version conflicts.
I see two possible solutions: Use the groovy-all-1.5.0.jar when running Groovy from IDEA (preferable) or put the Groovy jars last in the classpath.
I ran a test whereby I copied the command line that IDEA generated into a shell script which I then edited to use the groovy-all-1.5.0.jar instead of all the jars in the groovy/lib directory. The test runs then.
Edited by: Erik Husby on Apr 10, 2008 10:40 AM