Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-4251

karaf-maven-plugin register its own URLStreamHandlerFactory for mvn

    XMLWordPrintableJSON

Details

    • Question
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.5
    • None
    • karaf
    • None

    Description

      The karaf-maven-plugin registers its own URLStreamHandlerFactory for the protocol mvn see here.

      InstallKarsMojo.java
      static {
              URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory() {
                  public URLStreamHandler createURLStreamHandler(String protocol) {
                      if ("wrap".equals(protocol)) {
                          return new org.ops4j.pax.url.wrap.Handler();
                      }
                      if ("mvn".equals(protocol)) {
                          return new org.ops4j.pax.url.mvn.Handler();
                      }
                      return null;
                  }
              });
          }
      

      1. Why is this necessary?
      2. Why not using the system property java.protocol.handler.pkgs?

      I tried to set the URLStreamHandlerFactory in a project where I use the karaf-maven-plugin which leads to the exception 'factory already set....'
      3. Is it possible to implement a check whether the protocol mvn is already?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              easterwood Alexander Osterwald
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: