I have been trying over the past few months to apply gradle plugins, specifically from GitHub using a buildscript block to my projects. I’m unable to get even the sample build.gradle files to execute without throwing ‘Plugin not found with id …’ errors.
Here’s an example of trying to apply the cargo plugin to a buildscript -
apply plugin: 'cargo'
repositories {
mavenCentral()
}
buildscript {
println 'RUNNING BUILDSCRIPT CONFIG!'
repositories {
add(new org.apache.ivy.plugins.resolver.URLResolver()) {
name = 'GitHub'
addArtifactPattern 'http://cloud.github.com/downloads/[organisation]/[module]/[module]-[revision].[ext]'
}
}
dependencies {
classpath 'bmuschko:gradle-cargo-plugin:0.3'
}
}
cargo {
containerId = 'tomcat6x'
port = 8080
context = "mycontext"
remote {
hostname = "192.168.1.101"
username = "tomcat"
password = "tomcat"
}
}
dependencies {
providedCompile 'javax.servlet:servlet-api:2.5'
cargo 'org.codehaus.cargo:cargo-core-uberjar:1.1.1',
'org.codehaus.cargo:cargo-ant:1.1.1',
'jaxen:jaxen:1.1.1'
}
When I execute gradle tasks this is what I see in the console -
d:\Learning\marcinkwiatkowski-gradle-webapp-8aa798a>gradle tasks RUNNING BUILDSCRIPT CONFIG!
FAILURE: Build failed with an exception.
-
Where: Build file ‘D:\Learning\marcinkwiatkowski-gradle-webapp-8aa798a\build.gradle’ line: 1
-
What went wrong: A problem occurred evaluating root project ‘marcinkwiatkowski-gradle-webapp-8aa798a’. > 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
Any ideas what I’m doing wrong here?
Thanks,
-Zach