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

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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None

      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.

          [JENKINS-5427] hudson.init.Initializer annotation does not work from within plugins

          Alan Harder added a comment -

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

          Alan Harder added a comment - Workaround is to define a Plugin class and override start() or postInitialize().

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

          I think this construct is useful for plugins, too.

          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.

          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

          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

          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

          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

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

              Created:
              Updated:
              Resolved: