3 Replies Latest reply on Feb 18, 2008 3:25 PM by Adrian Brock

    Maven and url stream handlers

    Adrian Brock Master

      Related to this thread
      http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130111#4130111

      If you checkout the latest MC project and try to run the classloader-vfs
      tests it tells you can't create VFS files. This is because it doesn't recognise
      the vfsfile: protocol (even though it has been added to the system properties).

      This issue is specific to Maven, the tests work fine in the Eclipse.

      I tried to debug this before, but I couldn't work out the cause,
      because if I added a modified version of the URL class (with extra debugging)
      to the bootstrap classpath I couldn't reproduce the problem.

      The class from Sun's src.jar doesn't match what's in the JDK. ;-(

      I ended up hacking the test using reflection and setAccesible(true)
      to set the vfs url handler manually on the URL object.
      But I don't want to do that here, the construction of the VFS files
      are not in a test in this case, they are in real code.

      I'm guessing this has something to do with the way Maven is playing
      with the classloaders?