Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata

The annotation @Extension is used to mark implementations of Extension points for Jenkins. Jenkins itself creates instances of the extensions and attaches them to the right extension point instance. How the extension instances are created depends on where the annotation is placed.

The javadoc of @Extension lists the possible usage options.

If your plugin was written following the old manual registration mechanism, there might be a pitfall:

  • The "recommended" setup is @Extension on the class (e.g. your plugin descriptor class), and don't create a singleton instance.
  • If you DO have a singleton instance, then @Extension must on that and not on the class. Otherwise Jenkins uses one instance of the descriptor and your code uses a different instance.
    See also this thread in the mailing list for details.
  • No labels