From the docs:
http://www.gradle.org/current/docs/userguide/organizing_build_logic.html#sec:external_dependencies
Example 41.5
import org.apache.commons.codec.binary.Base64

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath group: 'commons-codec', name: 'commons-codec', version: '1.2'
    }
}

task encode << {
    def byte[] encodedString = new Base64().encode('hello world\n'.getBytes())
    println new String(encodedString)
}
 
Your are saying that the "source code you want to compile" needs xercesimpl.

But the above, is how you configure your BUILD SCRIPT to have the capability to use xerces.

make sense?

Best,
Roger




phil swenson
May 13, 2011 6:25 PM

Here is my build.gradle

apply plugin: 'groovy'

dependencies {
groovy group: 'org.codehaus.groovy', name: 'groovy', version: '1.7.10'
runtime: 'org.apache.xerces:xercesImpl:2.9.1'

}

task hello {
doLast {
println 'Hello world!'
Class testClass =
Class.forName("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl")
assert testClass:
"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found"
println
}
}

when I run "gradle hello" I get:

:hello
Hello world!

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/phil/dev/sag/scratchproj/build.gradle' line: 13

* What went wrong:
Execution failed for task ':hello'.
Cause: java.lang.ClassNotFoundException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

NO idea why......

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

http://xircles.codehaus.org/manage_email


Reply via email to