我是gradle的新手,我不明白插件是如何工作的。
我正在尝试使用货物插件而不使用maven存储库,但从http://mvnrepository.com/artifact/cargo/cargo/0.6下载jar文件并将其放入我的lib文件夹。
我的构建文件是:
apply plugin: 'war'
apply plugin: 'cargo'
configurations {
weblogic
}
def Properties tomcatDeployProps = new Properties()
tomcatDeployProps.load( new FileInputStream(project.file("src/conf/tomcat-deploy.properties")))
buildscript {
repositories {
flatDir dirs: "${rootProject.projectDir}/libs"
}
dependencies {
classpath 'org.gradle.api.plugins:cargo:0.6'
}
}
dependencies {
cargo 'cargo:cargo:0.6'
}
这是一个多项目配置,此build.gradle位于子项目中。
当我跑步时
$ gradle tasks
* Config properties
> environment : tst
> dbPropsFile : C:\developer\projects\FINEOS\fineos8.1\branches\dev\ServiceMonitor\conf\tst-db.properties
> deployPropsFile : C:\developer\projects\FINEOS\fineos8.1\branches\dev\ServiceMonitor\conf\tst-deploy.properties
> casetypePropsFile : C:\developer\projects\FINEOS\fineos8.1\branches\dev\ServiceMonitor\conf\etc\bo-mappings\tst-casetype.properties
> tasktypePropsFile : C:\developer\projects\FINEOS\fineos8.1\branches\dev\ServiceMonitor\conf\etc\bo-mappings\tst-tasktype.properties
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\developer\projects\FINEOS\fineos8.1\branches\dev\ServiceMonitor\ecrm-webapp\build.gradle' line: 3
* What went wrong:
A problem occurred evaluating project ':ecrm-webapp'.
> Failed to apply plugin [id 'cargo']
> Plugin with id 'cargo' not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2.091 secs
有人可以帮我配置这个插件吗? 感谢
答案 0 :(得分:0)
假设 gradle-cargo-plugin-0.6.1.jar 位于 lib 文件夹下,以下 build.gradle 脚本应用< em> cargo 插件:
buildscript {
dependencies {
classpath fileTree('lib')
}
}
apply plugin: 'java'
apply plugin: 'cargo'
cargo {
containerId = 'tomcat6x'
}