How to compile and build Gerrit Plugins?

To build Gerrit Plugins from source, you need:

A Linux or macOS system (Windows is not supported at this time)

zip, unzip, wget

$yum install zip -y
$ yum install unzip -y
$ yum install wget -y
$ yum install git -y

Python 2 or 3
This is installed in each RHEL 7 and Ubunutu server by defaul.


curl --silent --location | sudo bash -
curl --silent --location | sudo bash -
sudo yum -y install nodejs


## RHEL/CentOS 7 64-Bit ##
$ wget
$ cp vbatts-bazel-epel-7.repo /etc/yum.repos.d/
$ yum install -y bazel

How to Installing Bazel on Ubuntu?


$ cd /opt
$ wget
$ unzip
$ mv apache-maven-3.5.4 maven
$ export PATH=$PATH:/op/maven/bin


[code language=”text”]$ sudo yum install gcc-c++ make[/code]

Now, Bazel in tree driven means it can only be built from within Gerrit tree. Clone or link the plugin into gerrit/plugins directory:

# First become a non-root user

A JDK for Java 8

$ cd
$ wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie"
$ tar -xvf jdk-8u181-linux-x64.tar.gz
$ export JAVA_HOME=/home/ec2-user/jdk1.8.0_181
$ java -version

Follow for Gerrit.war

$ git clone --recursive
$ cd gerrit 
$ bazel build release

Follow for plugins such as its-jira

$ cd plugins
$ git clone
$ git clone
$ bazel build plugins/its-jira

The output can be normally found in the following directory:


# Some plugins describe their build process in src/main/resources/Documentation/ file. It may worth checking.

# Some plugins cane be build using maven as well