gerrit plugins, how to build them?

2,111 views
Skip to first unread message

Grégory Bougeard

unread,
Jul 4, 2013, 3:23:49 AM7/4/13
to repo-d...@googlegroups.com
Hi,

I tried to build some gerrit plugins from source, as how far as I know there not available as binaries, and I have some issues with Gerrit maven repositories.
I did not found a doc link about it, which maven repo to use, best practices about building plugins, or maybe plugins binaries availability on something like BinTray.

So, do you have more informations about plugins?

thx a lot

Luca Milanesio

unread,
Jul 4, 2013, 3:29:27 AM7/4/13
to Grégory Bougeard, repo-d...@googlegroups.com
Hi Gregory,

there a couple of presentations on SlideShare on how to use plugins:

With regards to the Gerrit internal plugins (replication, reviewnotes, commit-message-length-validator) they are already packaged with the Gerrit war and can be installed during the init phase.

Additional documentation on how to develop a plugin is included in Gerrit documentation:

Are you missing anything else ?

Luca.

--
--
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/groups/opt_out.
 
 

Grégory Bougeard

unread,
Jul 4, 2013, 3:36:55 AM7/4/13
to repo-d...@googlegroups.com, Grégory Bougeard
Yes. As I said, I'm not developing plugins, I want to use them.

Example : I cloned the branch-network plugin git repo.
When I want to build it I have issue about its dependencies like this :

[INFO] Failed to resolve artifact.

Missing:
----------
1) com.google.gerrit:gerrit-server:jar:2.6-SNAPSHOT


First, maybe I should update Gerrit version to use 2.6.1 and I think I have to add the maven repositiory where gerrit-server is hosted (I'm using a nexus proxy) and I did not found any informations about maven repository configuration.

Luca Milanesio

unread,
Jul 4, 2013, 3:42:54 AM7/4/13
to Grégory Bougeard, repo-d...@googlegroups.com
Hi Gregory,
additional plugins are not available in binary form but only as source code.

Commercial distribution of Gerrit (i.e. GerritForge) provide an "out-of-the-box" solution that includes a bunch of additional plugin compiled, integrated and ready to be used.
There is not yet a "plugin central" for Gerrit unfortunately.

Luca.

Grégory Bougeard

unread,
Jul 4, 2013, 3:44:43 AM7/4/13
to repo-d...@googlegroups.com, Grégory Bougeard
I get it, that's why I'm trying to build them from source. But I cannot do it because of the maven conf issue I noted. 

Luca Milanesio

unread,
Jul 4, 2013, 3:47:15 AM7/4/13
to Grégory Bougeard, repo-d...@googlegroups.com
The error you have is because the referenced version (2.6-SNAPSHOT) does not exist anymore as version but is final now.
Try to remove the "-SNAPSHOT" on the pom.xml dependency.

Luca.

Grégory Bougeard

unread,
Jul 4, 2013, 3:50:08 AM7/4/13
to repo-d...@googlegroups.com, Grégory Bougeard
I did and it's not working too.

gerrit-plugins dependencies are not in any maven repository and the pre-requisite is too build gerrit locally and install it in a local maven repository.
Can you confirm that?

My following question will be: why gerrit jars are not hosted on Central or another Maven repository?

Bassem Rabil

unread,
Jul 4, 2013, 11:58:20 AM7/4/13
to repo-d...@googlegroups.com, Grégory Bougeard
Hi Gregory 

I was facing the same error with building plugins, I tried building the plugins from the top level of gerrit, but it seems to me that the plugins libraries was not built properly. I went through the relevant libraries and built/installed the relevant plugin artifacts, then went to the plugin code and modified the pom.xml to point to 2.6 instead of 2.6-SNAPSHOT, and it worked. Here what I did to make it work:

[1] Clone gerrit and checkout stable 2.6 branch
git checkout -b stable-2.6 remotes/origin/stable-2.6

You need to clone the code for the plugin and checkout "stable-2.6" branch which should be compatible with gerrit API libraries for 2.6

[2] Build and install plugin APIs and Artifacts
cd gerrit-plugin-api
mvn clean package install
---
cd ../gerrit-plugin-archetype
mvn clean package install
---
cd ../gerrit-plugin-js-archetype
mvn clean package install

[3] Modify the plugin pom.xml to point to 2.6 rather than 2.6-SNAPSHOT
  <dependencies>
    <dependency>
      <groupId>com.google.gerrit</groupId>
      <artifactId>gerrit-plugin-api</artifactId>
      <version>2.6</version>
    </dependency>
  </dependencies>


Then the plugin was built successfully. I tried this with hooks-its and hooks-rtc plugins.

I hope this helps.

Regards
Bassem

Luca Milanesio

unread,
Jul 4, 2013, 12:03:09 PM7/4/13
to Bassem Rabil, repo-d...@googlegroups.com, Grégory Bougeard
One note: the cd ../gerrit-plugin-js-archetype && mvn clean package install is not strictly needed if you are not building a JavaScript UX plugin.

Luca.

Rahul Khanna

unread,
Aug 21, 2014, 4:01:54 AM8/21/14
to repo-d...@googlegroups.com, bassem.ra...@ericsson.com, gbou...@gmail.com
Hi

Using gerrit 2.9 release and trying to implement gerrit bugzilla integration. To resolve the dependencies of its-bugzilla on its-base getting error in code compilations.
Has anyone build gerrit 2.0 plugin for bugzilla??
Referring to https://gerrit.googlesource.com/plugins/its-base.


Rahul
Reply all
Reply to author
Forward
0 new messages