plugins/.
How plugins are loaded
Redmine usesRedmine::PluginLoader to discover and load plugins. At startup it:
- Scans every subdirectory of
plugins/and creates aPluginPathobject for each one. - Adds each plugin’s
lib/directory to Rails’ autoload paths. - After all eager-loading is done, runs each plugin’s
init.rbinitializer. - Fires the
:after_plugins_loadedhook so plugins can react to the fully-loaded state.
init.rb file is the entry point for every plugin. It calls Redmine::Plugin.register to declare the plugin’s metadata and configure its integration points.
Plugin directory structure
A standard plugin follows the same Rails conventions as the Redmine core, placed insideplugins/<plugin_name>/.
Only
init.rb is required. You can omit any directory you do not need.The init.rb entry point
Every plugin registers itself with Redmine::Plugin.register. The block is evaluated in the context of the plugin object, giving you access to all registration methods.
Plugin registration API
The following methods are available inside theregister block.
name, author, description, version, url, author_url
name, author, description, version, url, author_url
requires_redmine
requires_redmine
Raises
Redmine::PluginRequirementError at load time if the running Redmine version does not satisfy the requirement.requires_redmine_plugin
requires_redmine_plugin
Raises
Redmine::PluginRequirementError if another plugin is not installed or its version is insufficient.menu
menu
permission and project_module
permission and project_module
Registers access-control permissions, optionally grouped under a project module that users can enable per project.
settings
settings
Declares configurable settings for the plugin. See Plugin settings for details.
activity_provider
activity_provider
Registers a model as a source of events in the Activity feed.
wiki_format_provider
wiki_format_provider
Registers a custom wiki formatter.
Plugin lifecycle
Generating a plugin scaffold
Redmine ships with a generator that creates the full directory structure and starter files:Build your first plugin
Follow the step-by-step tutorial to create a working plugin from scratch.
