Failure Using the Gradle JPI Plugin

90 views
Skip to first unread message

Thomas Goeppel

unread,
Jan 5, 2015, 2:57:52 PM1/5/15
to jenkin...@googlegroups.com
Hello developers community!

I'd like to experiment with Jenkins plugins written in Groovy, and to get started I'm trying to build a Groovy Jenkins plugin demo from Shiran Rubin's talk at the 2014 Jenkins conference in Israel (video, slides, my fork of the github-repository).

The build fails with the following error message:

 
:compileGroovy
:processResources UP-TO-DATE
:classes
:jpi FAILED

FAILURE
: Build failed with an exception.

* What went wrong:
Execution failed for task ':jpi'.
> java/util/HashMap$Entry

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

I'm using Ubuntu 14.04, and since I couldn't find tool version requirements, I installed most things from packages.

"gradle -version" prints the following versions:
------------------------------------------------------------
Gradle 1.4
------------------------------------------------------------

Gradle build time: Monday, September 9, 2013 8:44:25 PM UTC
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.3 compiled on April 8 2014
JVM
: 1.7.0_65 (Oracle Corporation 24.65-b04)
OS
: Linux 3.13.0-44-generic amd64


I tried the following, without seeing the error message change:

  • build with the "--debug" option, and Gradle prior to 2.0 had issues with Java1.8 -> I downgraded to Java/JDK1.7 * changed the gradle-jpi-plugin dependency from version 0.5.0 to 0.7.2
  • used the dependencies I found in the job-dsl-plugin (e.g. "gradleVersion = '1.12'")

A generally recommendation in the Gradle forums is upgrading Gradle, and Groovy, to version 2.x. I do that, since it's not clear to me how the Groovy version used in Jenkins relates to the version used by the build tools (e.g. version of groovyc in the environment).

It would be nice if someone with more experience could have a look at it, and could shed some light on the Groovy version tool/build dependencies!

Thanks in advance!

Daniel Spilker

unread,
Jan 5, 2015, 3:18:31 PM1/5/15
to jenkin...@googlegroups.com
Hi!

Sorry, the documentation does not give any recommendations. The recommended Gradle version for the Gradle JPI Plugin is 1.12. Newer versions will cause problems, the next version will support Gradle 2.2.1.

You have to use Java 7 since Java 8 also causes problems (https://issues.jenkins-ci.org/browse/JENKINS-25643). If you want to share your plugin with other users, you should probably stick to JDK6 since that's the minimum version supported by Jenkins, see https://wiki.jenkins-ci.org/display/JENKINS/Java+5+Compatibility.

Jenkins will provide a Groovy runtime for plugins (which is currently 1.8.9), you should use that version to avoid problems. It's added to the dependencies automatically by the Gradle JPI plugin.

Daniel

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/2092c5b5-1d1d-475e-a251-c0d690720601%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Goeppel

unread,
Jan 6, 2015, 6:07:28 AM1/6/15
to jenkin...@googlegroups.com
Daniel,

thanks for the fast reply!

Your hint was good, even if I already had been using Java 7 in my programming environment. After downgrading to Java 6, "groovyw jpi" works!

But what should I say, installing an outdated version of Java is a small price to pay if the goal is using a modern programming language :-)

Cheers,
Thomas

Daniel Spilker

unread,
Jan 8, 2015, 5:59:42 PM1/8/15
to jenkin...@googlegroups.com
The gradle-jpi-plugin 0.7.2 can be used with Gradle 1.12 and JDK 7. Make sure to update the wrapper when changing Gradle versions.

That said, I released gradle-jpi-plugin 0.8.0 which must be used with Gradle 2.2.1 and JDK7 or JDK8. Have a look at the changelog: https://github.com/jenkinsci/gradle-jpi-plugin/blob/0.8.0/CHANGELOG.md

Daniel

Reply all
Reply to author
Forward
0 new messages