On Jan 8, 2009, at 10:11 PM, [email protected] wrote:

I apologize if I'm overlooking something obvious, but I've read through the manual and I can't find an answer.

I've got the following build.gradle:

-------------------------------------

usePlugin('java')
usePlugin('groovy')

sourceCompatibility = 1.6
targetCompatibility = 1.6
group = 'justin.test'
version = '1.0'
-------------------------------------

You _have_ to specify a groovy binary to be used by your project. Gradle comes shipped with one particular version of Groovy for internal usage. This version is intentionally separated from the groovy version needed by your project.

See: http://gradle.org/userguide/0.5.1/userguidech11.html#x31-6900011

You need to add to your build script something like:

dependencies {
      addMavenRepo()
      groovy "org.codehaus.groovy:groovy-all:1.5.7"
 }

- Hans



I've got one java file in src/main/java and one groovy test case in src/test/groovy. The content isn't important from what I can tell.

When I run "gradle-0.5.1/bin/gradle libs", I get the following:

-------------------------------------
:clean
:init
:resources
:compile
:testResources
:testCompile
Exception in thread "main" java.lang.NoClassDefFoundError: org/ codehaus/groovy/ant/Groovyc Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.ant.Groovyc
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

Build failed with an exception.
Run with -s or -d option to get more details. Run with -f option to get the full (very verbose) stacktrace.

Build file '/home/justin/build/hive/subjectivelogic/build.gradle'

Execution failed for task :testCompile.
Cause: Forked groovyc returned error code: 1

BUILD FAILED

Total time: 5.528 secs
-------------------------------------

I ran with '-d' and I can see that it's spawning groovyc with:

/usr/lib/jvm/java-6-sun-1.6.0.07/jre/bin/java \
-classpath \
/home/justin/build/build/classes:/home/justin/gradle-0.5.1/lib/ant- launcher-1.7.0.jar:/home/justin/gradle-0.5.1/lib/ant-1.7.0.jar \
org.codehaus.groovy.ant.Groovyc \
--classpath \
/home/justin/build/build/classes:/home/justin/gradle-0.5.1/lib/ant- launcher-1.7.0.jar:/home/justin/gradle-0.5.1/lib/ant-1.7.0.jar \
-j \
-Fg \
-Jsource=1.6 \
-Jtarget=1.6 \
/home/justin/build/build/test-classes \
/home/justin/build/src/test/groovy

It's missing a classpath reference to the groovy jar. I manually typed in the command line with that jar added. It then failed to find a junit class. I manually added that one and it compiled fine.

Am I supposed to be manually adding dependencies on these even though they're part of the gradle distribution?

Thanks,
-Justin
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to