Hi,

I'm  trying to use the groovy-maven plugin. This is my configuration:

           <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>groovy-maven-plugin</artifactId>
               <executions>
                   <execution>
                       <goals>
                           <goal>testCompile</goal>
                       </goals>
                       <configuration>
                           <sources>
                               <fileset>
                                   <directory>${pom.basedir
}/src/test/groovy</directory>
                                   <includes>
                                       <include>**/*.groovy</include>
                                   </includes>
                               </fileset>
                           </sources>
                       </configuration>
                   </execution>
               </executions>
           </plugin>

I have these 2 dependencies:

       <dependency>
           <groupId>junit</groupId>
           <artifactId>junit</artifactId>
           <version>3.8.1</version>
           <scope>test</scope>
       </dependency>
       <dependency>
           <groupId>groovy</groupId>
           <artifactId>groovy-all</artifactId>
           <version>1.0</version>
           <scope>test</scope>
       </dependency>

I have a really simple test which extends GroovyTestCase. Using the goal
groovy:testCompile I get this error:

java.lang.NoClassDefFoundError: junit/framework/TestCase
       at java.lang.ClassLoader.defineClass1(Native Method)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
       at java.security.SecureClassLoader.defineClass(
SecureClassLoader.java:12
4)
       at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
       at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
       at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
       at org.codehaus.classworlds.RealmClassLoader.loadClassDirect
(RealmClassL
oader.java:195)
       at org.codehaus.classworlds.DefaultClassRealm.loadClass
(DefaultClassReal
m.java:255)
       at org.codehaus.classworlds.RealmClassLoader.loadClass
(RealmClassLoader.
java:214)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
       at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java
:643)
       at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java
:504)
       at org.codehaus.groovy.control.ResolveVisitor.resolveToClass
(ResolveVisi
tor.java:506)
etc.

junit and groovy-all are in my repository. I've tried various things like
removing scope=test, explicity importing junit.framework.TestCase into the
Groovy test, just keep getting this same error.

Does anyone have an open source project with this working I could look at?

any help much appreciated

David Black
http://www.codecurl.org

Reply via email to