Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-2795

Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.5
    • Fix Version/s: 2.0.5
    • Component/s: None
    • Labels:
      None

      Description

      I had a problem when executing the Checkstyle plugin (version 2.1) with the pre-release of Maven 2.0.5. So I dug a bit to see if this could be related to maven core or not, and here is what I found.

      I isolated the code that breaks the build in the checkstyle plugin: it happens when the plugin tries to load my Checkstyle configuration file, which is actually located in a JAR that is specified in the build extensions. The code lies in the Locator#resolveLocation() method:

      // Attempt a Resource.
      URL url = this.getClass().getClassLoader().getResource( location );

      This code returns null for the "url" variable, which in turns breaks the plugin because it doesn't find any configuration file.

      I haven't had the time to dig more into it, but I found the following issue that might be related to this problem: "MNG-2228 : Classloader problem loading jars from build extensions". Brett and Carlos worked on it and fixed it, so maybe they could tell more about it.

      I attached the logs of the execution with Maven 2.0.4 (which works fine) and Maven 2.0.5 (which breaks). I haven't had the time yet to dig further into that problem.

        Attachments

        1. Test-BuildExtension.zip
          3 kB
          Fabrice Bellingard
        2. Checkstyle-2.0.5.txt
          33 kB
          Fabrice Bellingard
        3. Checkstyle-2.0.4.txt
          29 kB
          Fabrice Bellingard

          Issue Links

            Activity

              People

              • Assignee:
                jvanzyl Jason van Zyl
                Reporter:
                fabemn Fabrice Bellingard
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: