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

add a new classloader ("a la" child first for plugin)

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None

      In order to implement a maven3-plugin, we need a new class loader mechanism to mask current maven classes which are in core (through maven-plugin).

        1. ChildFirstClassLoader.java
          4 kB
        2. ChildFirstClassLoader.java
          3 kB
        3. HUDSON-5360
          7 kB
        4. HUDSON-5360
          8 kB
        5. HUDSON-5360
          9 kB

          [JENKINS-5360] add a new classloader ("a la" child first for plugin)

          Olivier Lamy added a comment -

          here an other proposal.
          This works here with a maven3-plugin.
          If you want I can checkin this last one (but it's a very POC and very in PROGRESS work ).

          Olivier Lamy added a comment - here an other proposal. This works here with a maven3-plugin. If you want I can checkin this last one (but it's a very POC and very in PROGRESS work ).

          zlosch added a comment - - edited

          From some mail traffic on hudson-dev I guess that it's a blocker to the issue I opened for Maven 3 compatibility.

          zlosch added a comment - - edited From some mail traffic on hudson-dev I guess that it's a blocker to the issue I opened for Maven 3 compatibility.

          azgard added a comment -

          I think also this Bug is a blocker.

          After the maven 3.0. beta1 release more and more developer would switch.

          Please check it.

          azgard added a comment - I think also this Bug is a blocker. After the maven 3.0. beta1 release more and more developer would switch. Please check it.

          The proposed patch doesn't make sense to me — that is, PluginFirstClassLoader is not doing anything useful, because its child URLClassLoader and its "2nd parent" URLClassLoader has the exact same content, the former always load everything that the latter can load. Plus you still have the same problem of the 2nd URLClassLoader not having any parent.

          I don't think you can create a child-first classloader by delegating to another URLClassLoader. You really need your own URLClassLoader-like implementation (for example AntClassLoader might be a good start) that does child-first.

          Kohsuke Kawaguchi added a comment - The proposed patch doesn't make sense to me — that is, PluginFirstClassLoader is not doing anything useful, because its child URLClassLoader and its "2nd parent" URLClassLoader has the exact same content, the former always load everything that the latter can load. Plus you still have the same problem of the 2nd URLClassLoader not having any parent. I don't think you can create a child-first classloader by delegating to another URLClassLoader. You really need your own URLClassLoader-like implementation (for example AntClassLoader might be a good start) that does child-first.

          Code changed in hudson
          User: : olamy
          Path:
          trunk/hudson/tools/maven-hpi-plugin/src/main/java/org/jvnet/hudson/maven/plugins/hpi/AbstractHpiMojo.java
          http://jenkins-ci.org/commit/33086
          Log:
          adding a new Manifest entry to be able to play with JENKINS-5360

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : olamy Path: trunk/hudson/tools/maven-hpi-plugin/src/main/java/org/jvnet/hudson/maven/plugins/hpi/AbstractHpiMojo.java http://jenkins-ci.org/commit/33086 Log: adding a new Manifest entry to be able to play with JENKINS-5360

          Olivier Lamy added a comment -

          here a new patch.
          A work in progress (or POC which needs a lot of more jobs regarding maven 3 in hudson is here : http://github.com/olamy/hudson-maven3-support

          Olivier Lamy added a comment - here a new patch. A work in progress (or POC which needs a lot of more jobs regarding maven 3 in hudson is here : http://github.com/olamy/hudson-maven3-support

          Olivier Lamy added a comment -

          a patch with more help methods (getURLs returning jars)

          Olivier Lamy added a comment - a patch with more help methods (getURLs returning jars)

          Code changed in hudson
          User: : olamy
          Path:
          trunk/hudson/main/core/pom.xml
          trunk/hudson/main/core/src/main/java/hudson/ClassicPluginStrategy.java
          trunk/hudson/main/core/src/main/java/hudson/PluginFirstClassLoader.java
          trunk/hudson/main/core/src/main/java/hudson/security/Permission.java
          http://jenkins-ci.org/commit/35076
          Log:
          JENKINS-5360 add a new classloader ("a la" child first for plugin)

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : olamy Path: trunk/hudson/main/core/pom.xml trunk/hudson/main/core/src/main/java/hudson/ClassicPluginStrategy.java trunk/hudson/main/core/src/main/java/hudson/PluginFirstClassLoader.java trunk/hudson/main/core/src/main/java/hudson/security/Permission.java http://jenkins-ci.org/commit/35076 Log: JENKINS-5360 add a new classloader ("a la" child first for plugin)

          Code changed in hudson
          User: : olamy
          Path:
          trunk/www/changelog.html
          http://jenkins-ci.org/commit/35077
          Log:
          JENKINS-5360 update changelog

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : olamy Path: trunk/www/changelog.html http://jenkins-ci.org/commit/35077 Log: JENKINS-5360 update changelog

          dogfood added a comment -

          Integrated in hudson_main_trunk #287
          JENKINS-5360 add a new classloader ("a la" child first for plugin)

          olamy :
          Files :

          • /trunk/hudson/main/core/src/main/java/hudson/security/Permission.java
          • /trunk/hudson/main/core/pom.xml
          • /trunk/hudson/main/core/src/main/java/hudson/PluginFirstClassLoader.java
          • /trunk/hudson/main/core/src/main/java/hudson/ClassicPluginStrategy.java

          dogfood added a comment - Integrated in hudson_main_trunk #287 JENKINS-5360 add a new classloader ("a la" child first for plugin) olamy : Files : /trunk/hudson/main/core/src/main/java/hudson/security/Permission.java /trunk/hudson/main/core/pom.xml /trunk/hudson/main/core/src/main/java/hudson/PluginFirstClassLoader.java /trunk/hudson/main/core/src/main/java/hudson/ClassicPluginStrategy.java

            olamy Olivier Lamy
            olamy Olivier Lamy
            Votes:
            6 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: