Groovy 如何引用Gradle 0.6中的类路径

Groovy 如何引用Gradle 0.6中的类路径,groovy,build,gradle,Groovy,Build,Gradle,我有一个作为构建工具使用的项目,我必须利用。这个任务中的一个子元素是对类路径的引用,我想使用refid。构建脚本使用Gradle的。由于编译任务可以正常工作,我知道类路径设置正确: dependencies { compile 'commons-beanutils:commons-beanutils:1.8.0' compile group: 'commons-lang', name: 'commons-lang', version: '2.4' ... } 依赖关系{ 编译“com

我有一个作为构建工具使用的项目,我必须利用。这个任务中的一个子元素是对类路径的引用,我想使用refid。构建脚本使用Gradle的。由于编译任务可以正常工作,我知道类路径设置正确:

dependencies { compile 'commons-beanutils:commons-beanutils:1.8.0' compile group: 'commons-lang', name: 'commons-lang', version: '2.4' ... } 依赖关系{ 编译“commons beanutils:commons beanutils:1.8.0” 编译组:“commons lang”,名称:“commons lang”,版本:“2.4” ... } 不,我想在Gradle构建脚本中引用这个类路径

我尝试了以下方法:

使用classpathId(内置?) 搜索Gradle邮件列表并找到建议:


project.dependencies.antpath('compile')


这会导致一个错误。也尝试了一些变体,但到目前为止运气不佳。非常感谢您的建议。

以下内容将访问配置的依赖项:

configurations.compile.asPath configurations.compile.asPath 如果您已经定义了自己的配置,您还可以利用:

configurations { gwtCompile } .... ant.java(classname:'com.google.gwt.dev.Compiler', fork:'true', failOnError: 'true') { jvmarg(value: '-Xmx184M') arg(line: '-war ' + gwtBuildDir) arg(value: 'com.yoobits.ocs.WebApp') classpath { pathElement(location: srcRootName + '/' + srcDirNames[0]) pathElement(path: configurations.compile.asPath) pathElement(path: configurations.gwtCompile.asPath) } } 配置{ GWT编译器 } .... java(类名:'com.google.gwt.dev.Compiler',fork:'true',failOnError:'true'){ jvmarg(值:'-Xmx184M') arg(行:'-war'+gwtBuildDir) arg(值:“com.yoobits.ocs.WebApp”) 类路径{ pathElement(位置:srcRootName+'/'+srcDirNames[0]) pathElement(路径:configurations.compile.asPath) pathElement(路径:configurations.gwtCompile.asPath) } } 在上面的示例中,我访问了编译路径和我自己的配置,这只在使用GWT编译器编译构建过程中的一个特殊阶段才有意义