Build compatible plugin jars on Jenkins?

92 views
Skip to first unread message

Joe Hansche

unread,
May 15, 2014, 2:57:34 PM5/15/14
to repo-d...@googlegroups.com
After trying (and failing) to get a plugin build environment set up in order to build and install plugins for Gerrit, I was pleased to find out that the Jenkins instance for Gerrit and plugins is publicly available and produces Jar artifacts for some (but not all ... for some reason?) of the plugins [1].  Unfortunately, the produced artifacts cannot be installed on my Gerrit instance, as I get:


com.google.gerrit.server.plugins.PluginInstallException: com/googlesource/gerrit/plugins/hooks/jira/JiraModule : Unsupported major.minor version 51.0
at com.google.gerrit.server.plugins.PluginLoader.runPlugin(PluginLoader.java:412)
at com.google.gerrit.server.plugins.PluginLoader.installPluginFromStream(PluginLoader.java:167)
at com.google.gerrit.sshd.commands.PluginInstallCommand.run(PluginInstallCommand.java:92)
at com.google.gerrit.sshd.SshCommand$1.run(SshCommand.java:35)
at com.google.gerrit.sshd.BaseCommand$TaskThunk.run(BaseCommand.java:442)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:364)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.UnsupportedClassVersionError: com/googlesource/gerrit/plugins/hooks/jira/JiraModule : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.google.gerrit.server.plugins.PluginLoader.load(PluginLoader.java:548)
at com.google.gerrit.server.plugins.PluginLoader.loadPlugin(PluginLoader.java:504)
at com.google.gerrit.server.plugins.PluginLoader.runPlugin(PluginLoader.java:387)
... 13 more
fatal: plugin failed to install


I believe (correct me if I'm wrong?) the "Unsupported major.minor version 51.0" error is because my Gerrit server is running Java 1.6, and the plugin was built for Java 7.  As far as I know, if the Jar had been built with a 1.6 target, it would remain compatible with both Java 6 and Java 7 -- is that not the case?

Would it be possible to have the Jenkins job that builds those plugins updated to produce both 1.6 and 1.7 versions of the jars, so that those of us who want to use certain plugins can simply grab the Jar and install it?

I understand Gerrit plugins are not yet in a state where there is a central repository of plugins (like Jenkins plugins, for example), and I'm fine with that..  But we should at least be able to find a pre-built Jar for any plugin we want to try out, instead of having to jump through flaming, glass-sharded, microscopic hoops just to get one jar that can actually be installed and used in a running Gerrit instance.  The process is very frustrating.

Any other suggestions?

Thanks,
Joe

Thomas Swindells (tswindel)

unread,
May 15, 2014, 3:04:39 PM5/15/14
to Joe Hansche, repo-d...@googlegroups.com

Why not run a supported version of java? Java 1.6 has been past its end of life for over a year now and java 7 has been around as a formal release for almost 3 (how time flies!)

See http://www.oracle.com/technetwork/java/eol-135779.html for details.

 

Thomas

 

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joe Hansche

unread,
May 15, 2014, 3:13:11 PM5/15/14
to repo-d...@googlegroups.com, Joe Hansche


On Thursday, May 15, 2014 3:04:39 PM UTC-4, Thomas Swindells wrote:

Why not run a supported version of java? Java 1.6 has been past its end of life for over a year now and java 7 has been around as a formal release for almost 3 (how time flies!)

Heh... Mostly because I wasn't aware that 6 had reached EOL already.  It feels like just last year the AOSP project finally started supporting Java 1.5!

I suppose that does change things...  Will have to investigate and make a plan for upgrading java across all of our servers, including Gerrit and Jenkins servers.

Thanks for the reality check :/

--
--
To unsubscribe, email repo-discus...@googlegroups.com

Thomas Swindells (tswindel)

unread,
May 15, 2014, 3:23:44 PM5/15/14
to Joe Hansche, repo-d...@googlegroups.com

From: repo-d...@googlegroups.com [mailto:repo-d...@googlegroups.com] On Behalf Of Joe Hansche
Sent: 15 May 2014 15:13
To: repo-d...@googlegroups.com
Cc: Joe Hansche
Subject: Re: Build compatible plugin jars on Jenkins?

 



On Thursday, May 15, 2014 3:04:39 PM UTC-4, Thomas Swindells wrote:

Why not run a supported version of java? Java 1.6 has been past its end of life for over a year now and java 7 has been around as a formal release for almost 3 (how time flies!)

Heh... Mostly because I wasn't aware that 6 had reached EOL already.  It feels like just last year the AOSP project finally started supporting Java 1.5!

 

I suppose that does change things...  Will have to investigate and make a plan for upgrading java across all of our servers, including Gerrit and Jenkins servers.

 

Thanks for the reality check :/

[Thomas Swindells] That’s ok, I think the problem is java 7 seemed to come in with such a long drawn out whimper that many people didn’t actually notice it had formally arrived rather than being yet another beta release.

Are you sure you don’t want to jump straight to java 8 though? Apparently there is only a year left of java 7 support! Though I’ve a feeling that Oracle may be forced to extend that out given java 8 doesn’t seemed to have made much impact yet.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com

Joe Hansche

unread,
May 15, 2014, 4:27:28 PM5/15/14
to repo-d...@googlegroups.com, Joe Hansche
Thanks.  Upgrading to Java 7 did the trick, and I'm able to install the plugin(s) using the artifact URL produced by ci.gerritforge.com.

I suspect there are still many installations out there using Java 6 though, and Gerrit itself does still support Java 6 (at least, it installs and runs).  So it might still be worth looking into changing those Jenkins jobs to set the javac target to Java 6, just so it can still work in those existing installations.

Thomas Broyer

unread,
May 17, 2014, 6:03:04 AM5/17/14
to repo-d...@googlegroups.com


On Thursday, May 15, 2014 8:57:34 PM UTC+2, Joe Hansche wrote:
After trying (and failing) to get a plugin build environment set up in order to build and install plugins for Gerrit, I was pleased to find out that the Jenkins instance for Gerrit and plugins is publicly available and produces Jar artifacts for some (but not all ... for some reason?) of the plugins [1].

I believe the "Plugins-stable-2.8" builds all "stable-2.8" branches in the plugin repos themselves. The gravatar plugin for instance only has a "master" branch so it's not there (but the master branch uses Gerrit Plugin API 2.8, and indeed builds against Gerrit 2.8)
No, because Jenkins is not the one fixing Java compat. The hooks-its plugins are explicitly built for Java 7: https://gerrit.googlesource.com/plugins/hooks-its/+/stable-2.8/pom.xml
Reply all
Reply to author
Forward
0 new messages