Extensibility

This site is the new docs site currently being tested. For the actual docs in use please go to https://www.jenkins.io/doc.

Jenkins is designed with extensibility in mind, both internally (core) and with plugins. Extensibility in Jenkins is accomplished by combining the concepts discussed below.

Extension annotation

Extension is an annotation that allows Jenkins to discover classes, instantiate them, and register them in global lists of implementations of their supertypes and interfaces. This works for implementations both directly in core, and contributed by plugins, so that plugins can provide implementations of extension points defined in core (or other plugins). Whenever Jenkins needs to provide a list, e.g. of security realm implementations (LDAP, Jenkins user database, etc.) it can query for all subtypes of SecurityRealm that are annotated with @Extension.

Descriptors and Describables

jenkinsdoc:Descriptor[] and jenkinsdoc:Describable[] (or subtypes thereof) are used whenever multiple instances of a certain extension are needed, for example build steps. The Descriptor can be used to store their global configuration, and as a factory, while the Describable is the specific instance with its independent, instance-specific configuration. This is similar to class/object in object-oriented programming.

Actionable and Actions

jenkinsdoc:Actionable[] is an abstract class allowing subtypes to be extensible using jenkinsdoc:Action[] implementations. jenkinsdoc:Action[] implementations can be used to store arbitrary data with a model object, or contribute additions to its presentation. The exact details vary depending on the subtype, but typically, jenkinsdoc:Actionable[] objects will show actions in the sidepanel, and route requests to the action’s getUrlName() to the action, allowing it to contribute pages to jenkinsdoc:Actionable[] objects.