On Mar 17, 2007, at 3:19 AM, David Black wrote:

Ok, great, progress but I'm not quite there yet. Using the new alpha-2 snapshot, I no longer get the unable to resolve junit error. However, with the test project I am now getting unable to resolve GroovyTestCase! :-( Is it just groovy-all I need in my dependency list? I've checked my groovy-all jar and GroovyTestCase is there ...

What?  Is it the same sample module?

If you still have problems... then send me another small module that shows the problem and I'll look into it more.

--jason


thanks for the quick turnaround
David

On 3/17/07, Jason Dillon <[EMAIL PROTECTED]> wrote:
Aight, I've fixed this. The classloader for compilation (groovy:compile and groovy:testCompile) is now much, much cleaner... only including the system classloader and the given classpath elements (from project/dependencies and configuration/ classpath if given).

I've just deployed a new 1.0-alpha-2-SNAPSHOT which has this fix. Please give it a try and let me know if you still see any problems.

 * * *

I have a feeling that similar problems may also occur with groovy:execute. I've already had to include the ant:ant* artifacts on the plugin's classpath so that AntBuilders can be used. I'm not sure what else might break because of this at the moment. But, gut tells me that I probably have to fix the groovy:execute classloader stuff in the same way.

I'm also considering adding an option which will dynamically add things like groovy:groovy-all and ant:ant to the classpath, unless asked not to... though I'm not sure if that is a good idea or not at the moment. So for now, you *must* add any groovy stuff (and deps of that groovy stuff) to the classpath when using groovy:compile or groovy:testCompile... but for groovy:execute those are added already.

If anyone has any examples of groovy:execute which is failing because some groovy class can't resolve some class in a dependency/ classpath element, please let me know so I can add a test case for it and fix it too ;-)

Cheers,

--jason


On Mar 16, 2007, at 12:52 PM, David Black wrote:

Thanks for the response Jason. I'm attaching a simple test project which fails with this error on my system.

Just to be clear, I'm using maven 2.0.5, JDK 1.5.0_09, and I'm doing a

mvn groovy:testCompile

at the command line.

Let me know if I can provide any more info.

David

On 3/16/07, Jason Dillon < [EMAIL PROTECTED]> wrote:
This is the second time I've heard of this... but I still can not reproduce this problem.

Can you (or someone else) who is seeing this problem, please make a simple test module (including the test srcs) that cause this exception to pop up?

If so I can debug it... but as right now I can not reproduce this problem. The test-compile integration test seems to be working just fine:

http://svn.codehaus.org/mojo/trunk/mojo/groovy-maven-plugin/ src/it/test-compile/

--jason


On Mar 16, 2007, at 5:26 AM, David Black wrote:

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



<simpletest1.zip>
---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email



Reply via email to