Support multiple Jira instances

Previously, its-jira only supported connecting to a single Jira server.
In corporate environments, it is not unusual to have multiple Jira
servers and it is a common requirement to integrate Gerrit with those.

This change enables its-jira to integrate with multiple Jira servers at
the Gerrit project level, i.e., a Gerrit project can be associated with
a particular Jira instance. This is done by specifying the Jira server
URL, username and password in the project configuration. The plugin adds
a "commentlink" section accordingly.

A typical Jira server configuration in project.config will look like:

   [plugin "its-jira"]
     enabled = true
     instanceUrl = http://localhost:8075/
     jiraUsername = admin
     password = admin

   [commentlink "its-jira"]
     match = ([A-Z]+-[0-9]+)
     link = http://localhost:8075/browse/$1

In case its-jira plugin is enabled for a project but no Jira server is
configured for this project, the default configuration will be the one
defined in gerrit.config. If no Jira server information is defined in
gerrit.config, an error is logged and the Jira integration is disabled
for the project.

Please note that this functionality is considered EXPERIMENTAL as the
credentials are stored in clear text at the project level and sensitive
information (the password of the Jira instance) could be exposed. The
work to add encryption is ongoing [1] and once a solution is found to
the raised issues, it will be leveraged by this plugin.

[1] https://gerrit-review.googlesource.com/c/gerrit/+/177390

Change-Id: I88f7298055ec1a136348758d4ec6fab67668e1ca
17 files changed
tree: 9486a321eaa7f2e58dbc0c4a36165ee65f250d11
  1. .settings/
  2. src/
  3. .gitignore
  4. BUILD
  5. external_plugin_deps.bzl
  6. LICENSE