karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Osterwald (JIRA)" <j...@apache.org>
Subject [jira] [Created] (KARAF-4251) karaf-maven-plugin register its own URLStreamHandlerFactory for mvn
Date Wed, 06 Jan 2016 13:08:39 GMT
Alexander Osterwald created KARAF-4251:
------------------------------------------

             Summary: karaf-maven-plugin register its own URLStreamHandlerFactory for mvn
                 Key: KARAF-4251
                 URL: https://issues.apache.org/jira/browse/KARAF-4251
             Project: Karaf
          Issue Type: Question
          Components: karaf-tooling
    Affects Versions: 3.0.5
            Reporter: Alexander Osterwald


The karaf-maven-plugin registers its own URLStreamHandlerFactory for the protocol _mvn_ [see
here|https://github.com/apache/karaf/blob/karaf-3.0.x/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java#L56].

{code:title=InstallKarsMojo.java|borderStyle=solid}
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;
            }
        });
    }
{code} 

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? 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message