Documentation for JIRA 4.2. Documentation for other versions of JIRA is available too.
A component plugin module defines a Java component which will be injected into the component system used by your plugin.
The details differ depending on whether you are writing a Plugins1 or Plugins2 plugin.
A component in a Plugins1 plugin will be installed into JIRA's core component manager (PicoContainer).
This means it will be inherently "public", that is available to other plugins to have injected into them.
Note, however, that these other plugins have no way to declare there dependency on your plugin, and so they would just throw errors at runtime if your plugin is unavailable.
A new component is simple to define as follows:
<component key="userService" name="User Service" class="com.atlassian.jira.rpc.soap.UserServiceImpl"> <interface>com.atlassian.jira.rpc.soap.UserService</interface> </component>
This example here defines a component implementing UserService that is put into the PicoContainer to inject into any other plugin modules. If you include this component module in your plugin, then your other plugin modules can define a constructor with a UserService parameter and this implementation will be provided to your plugin module automatically.
These components allow you to simplify the creation and management of your plugin modules quite a lot.
A component in a Plugins2 plugin will be installed into the Spring container for your plugin.
It will be "private" by default. This means classes in your plugin will be able to get that component dependency-injected, but other plugins will not.
However the component can be declared public, which allows other Plugins2 plugins to import a dependency on your component.
See the Plugins2 Component Plugin Module documentation for details.