You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org> on 2016/01/28 09:32:39 UTC

[jira] [Commented] (KARAF-4251) karaf-maven-plugin register its own URLStreamHandlerFactory for mvn

    [ https://issues.apache.org/jira/browse/KARAF-4251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15121021#comment-15121021 ] 

Jean-Baptiste Onofré commented on KARAF-4251:
---------------------------------------------

It's required when the features XML (in the kar) contains URL (in <bundle/> element) starting with blueprint: or wrap:.
We change the way we deal with that in karaf 4 (thanks to the profiles).

Do you still have the issue ?

> 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)