我创建了自定义任务,发布在 ivy 存储库中,现在我想使用它。我就是这样做的:
configurations {
customTask {
transitive = false
}
}
repositories {
mavenCentral()
ivy {
url 'http://my.ivy.rep/ivyrep/shared'
layout "pattern", {
artifact "[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
}
}
}
dependencies {
customTask 'org.apache.ant:ant-jsch:1.8.4'
customTask 'com.jcraft:jsch:0.1.49'
customTask group: 'pl.com', name:'MyCustomTask', version:'0.9', configuration: 'runtime'
}
task buildInstaller(type: eu.company.gradle.MyCustomTask) {
...
}
这是我的自定义任务:
package eu.company.gradle
class MyCustomTask extends DefaultTask {
public MyCustomTask() {}
@TaskAction
def build() {
// do something
}
}
下载了依赖项,但是当我想运行“buildInstaller”任务时,出现此错误:
Could not find property 'pl' on root project 'Configurable installer'.
看起来我的 jar 不在类路径中?