Plugin name is an important part for plugin developers and users: it drives
SSH command names, REST API endpoints, used as a prefix in project.config for
plugin-owned capabilities and can be used in project.config sections for
project specific configuration.
Currently there is no way for a plugin to provide its own name. When a new
version of a plugin is released and it is copied to $site/plugins folders
with unchanged name:
replication-2.8.SNAPSHOT.jar
then the plugin name in all places mentioned above is changed.
With this change plugin name can be optionally provided by plugins, instead of
deriving it from the plugin file name. To provide its own plugin name, plugin
has to put the following line in the manifest file:
Gerrit-PluginName: replication
This is especially useful for plugins that contribute plugin-owned capabilities
that are stored in project.config file as
[plugin-name]-[capability-name]
Other use case is to be able to put project specific plugin configuration
section in project.config. In this case it is advantageous to reserve the
plugin name to access the configuration section in project.config file.
Multiple versions of the same plugin with different file names can not be
deployed on one Gerrit installation site: only the first plugin can be
successful deployed. All other plugins with the same name are disabled.
If plugin provides its own name, it has some implications for SSH install
command and PUT /plugins/plugin-name REST endpoint. In both cases a name of the
plugin to install is passed from the user. If the plugin provides its own name
in MANIFEST file, the plugin name from the MANIFEST file has precedence over
the name passed to the SSH command or REST endpoint.
Change-Id: If28349e95be2e90c6ee8169a72ba8cd642b49b98