I am trying to create a task that will run java code that is built in
the current project. The user guide seems to indicate here:
http://gradle.org/0.8/docs/userguide/artifact_management.html#project_libraries
that the "default" configuration will be all runtime dependencies plus
archives. I assumed that this meant that the default java artifact jar
of my project would be part of "default" and so I could do something
like this:

task makeSodSite(dependsOn: jar)  << { task ->
    myArgs = '--run-once -p sod.prop'
    ant.java(dir:'build/output',
             classname:'edu.sc.seis.seiswww.MakeSite',
             args:myArgs,
             fork:true,
             classpath:configurations.default.asPath,
             output:project.projectDir.path+'/build/output/makeSodSite.out')
}

But it doesn't work, with a NoClassDefFoundError. I put in a few
prints, like this:
    println configurations.runtime.asPath
    println configurations.archives.asPath
    println configurations.default.asPath

and found that runtime and default seem to be identical and archives is empty.

Should the default artifact created by the java plugin be part of the
default configuration? Is there something besides depending on the jar
task that is required to get it there, or does it have to be done
manually? As an alternative, I could add "build/classes" to the
classpath manually, but that feels wrong to me.

Gradle 0.8

thanks,
Philip

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

    http://xircles.codehaus.org/manage_email


Reply via email to