Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5427

hudson.init.Initializer annotation does not work from within plugins

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      So far as I can tell, the classloader used for searching for @Initializer annotations is constructed before the plugins are available, so it doesn't search plugin classes. As a result, one can't use @Initializer for any phase in plugins. It'd be handy if there was a way to do this - or a second annotation, say, @PluginInitializer, which did search plugins.

        Attachments

          Activity

          Hide
          mindless Alan Harder added a comment -

          Workaround is to define a Plugin class and override start() or postInitialize().

          Show
          mindless Alan Harder added a comment - Workaround is to define a Plugin class and override start() or postInitialize().
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          Once the uber classloader is prepared, we should rescan the @Initializer and run them.

          I think this construct is useful for plugins, too.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - Once the uber classloader is prepared, we should rescan the @Initializer and run them. I think this construct is useful for plugins, too.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/src/main/java/hudson/PluginManager.java
          trunk/hudson/main/core/src/main/java/hudson/init/InitializerFinder.java
          trunk/hudson/main/core/src/main/java/hudson/model/Hudson.java
          trunk/www/changelog.html
          http://jenkins-ci.org/commit/35980
          Log:
          [FIXED JENKINS-5427] recognize @Initializer marked tasks from plugins

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/PluginManager.java trunk/hudson/main/core/src/main/java/hudson/init/InitializerFinder.java trunk/hudson/main/core/src/main/java/hudson/model/Hudson.java trunk/www/changelog.html http://jenkins-ci.org/commit/35980 Log: [FIXED JENKINS-5427] recognize @Initializer marked tasks from plugins
          Hide
          dogfood dogfood added a comment -

          Integrated in hudson_main_trunk #335
          [FIXED JENKINS-5427] recognize @Initializer marked tasks from plugins

          kohsuke :
          Files :

          • /trunk/hudson/main/core/src/main/java/hudson/model/Hudson.java
          • /trunk/hudson/main/core/src/main/java/hudson/PluginManager.java
          • /trunk/www/changelog.html
          • /trunk/hudson/main/core/src/main/java/hudson/init/InitializerFinder.java
          Show
          dogfood dogfood added a comment - Integrated in hudson_main_trunk #335 [FIXED JENKINS-5427] recognize @Initializer marked tasks from plugins kohsuke : Files : /trunk/hudson/main/core/src/main/java/hudson/model/Hudson.java /trunk/hudson/main/core/src/main/java/hudson/PluginManager.java /trunk/www/changelog.html /trunk/hudson/main/core/src/main/java/hudson/init/InitializerFinder.java

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            abayer Andrew Bayer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: