Failed to apply plugin [id 'com.terrafolio.jenkins'] > Could not create task of type 'UpdateJenkinsItemsTask'

Hi,

I was try to implement this https://github.com/ghale/gradle-jenkins-plugin tutorial in my local…

My Build.gradle fils as below. buildscript { repositories { jcenter() } dependencies { classpath(‘com.terrafolio:gradle-jenkins-plugin:1.2.3’) classpath “nl.ikoodi.gradle.plugin:gradle-jenkins-jobdsl:0.1.5” classpath “com.github.fowlie:gradle-jenkins-test:0.3”

} } apply plugin: “com.terrafolio.jenkins” apply plugin: “nl.ikoodi.jenkins.jobdsl” apply plugin: “com.github.fowlie.gradle-jenkins-test”

jenkins { // server definitions servers { demo { url ‘http://localhost:8080’ secure false } } defaultServer servers.demo // template definitions templates { template_job { dsl { description “This is a job derived from a template…” displayName “Template Job” steps { shell ‘echo “Gradle Rocks!”’ } } } } // job definitions jobs { [ “build”, “release” ].each { buildType -> “build_${buildType}” { dsl { using ‘template_job’ displayName “Cool ${buildType.capitalize()} Job” steps { gradle(buildType) } } } } } }

when I try to execute gradle tasks …Im getting bellow error…

  • What went wrong: A problem occurred evaluating root project ‘Gradle_Jenkins_managemnet’. > Failed to apply plugin [id ‘com.terrafolio.jenkins’]

Could not create task of type ‘UpdateJenkinsItemsTask’.

could you help me to get resolve this…thanks in advance…

Well, one problem is that there is a template named “templatejob” but then the jobs are defined using template “template_job”. Once I fixed that, your example seemed to work for me. What version of gradle are you running with?

Hi Gary,

This is the Gradle version which Im using.

------------------------------------------------------------ Gradle 2.2.1 ------------------------------------------------------------

Build time:

2014-11-24 09:45:35 UTC Build number: none Revision:

6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a

Groovy:

2.3.6 Ant:

Apache Ant™ version 1.9.3 compiled on December 23 2013 JVM:

1.6.0_37 (Sun Microsystems Inc. 20.12-b01) OS:

Windows 7 6.1 amd64

even though Im using template_job,still the same error exists…pls help me.

Hi Gary,

Looks like the problem with JDK version 1.6…I changed to 1.7…now its working fine…Thank you.