Ensure that plugin config is only sent for enabled plugins

Sending --plugin-config options will lead to errors if the
corresponding plugin is not available or disabled in the
target Gerrit server. Furthermore, for test systems, or in
case the client lacks permission for configuring plugins,
it should be possible to exclude/include certain plugins
from the --plugin-config mechanism.

This patch utilizes the new GerritClient#getPlugins() method
to determine, if a plugin referenced in ProjectOptions is
available and enabled in the target Gerrit server.

Additionally, two new configueration options, enabledPlugins
and disabledPlugins, have been added to GerritServerConfig.
The latter can be used to switch off --plugin-config for
a given list of plugins. The former can be used to switch
on --plugin-config for only a given list of plugins, but not
for all others. An empty enabledPlugins list will switch off
--plugin-config for all plugins. A plugin contained in both
lists will be treated as if disabled.

Change-Id: Id12ec437844cae4f6a92d0d12f59f5079d81278b
Signed-off-by: Michael Ochmann <michael.ochmann@sap.com>
3 files changed