Extensions and Plugins

Jenkins defines extension points, which are interfaces or abstract classes that model an aspect of its behavior. The interface or class defines contracts of what needs implementation, and Jenkins allows plugins to contribute those implementations.

To register an implementation, make sure you mark it with @Extension.

The extensions index is a useful list of the extension points used in Jenkins and Jenkins plugins.

Plugin Architecture

Jenkins' object model is extensible, and it supports the notion of "plugins," which plug into these extension points to extend the capabilities of Jenkins.

Each enabled plugin gets its own class loader, which delegates to Jenkins core and to the class loaders of the plugins it depends on. This allows two unrelated plugins to define classes with the same name, but it does not isolate plugins from the libraries bundled in Jenkins core. See Dependencies and Class Loading for details.

Plugins participate in system activities just like built-in Jenkins classes:

  • Persistence: Plugins participate in XStream-based persistence, storing their configuration and data alongside core objects in JENKINS_HOME.

  • Views: Plugins contribute user interface views using Jelly or Groovy, following the same conventions as core classes.

  • Static Resources: Plugins can provide static assets like images, CSS, and JavaScript files.

  • Web Endpoints: Plugins can contribute URL actions and Stapler web endpoints.

From a user perspective, everything works seamlessly: there is no distinction between functionality provided by Jenkins core and functionality provided by plugins.

For more details, see the Extensibility section and the Plugin Development chapter.