One more idea to try: 

Each <plugin> element in <build> can define its own additional things to
put on the classpath, by including <dependencies><dependency>....
elements.   See
http://maven.apache.org/ref/2.2.1/maven-model/maven.html#class_plugin -
the dependency element is defined as "Additional dependencies that this
project needs to introduce to the plugin's classloader".

So, for the felix features-maven-plugin, inside the <plugin> element for
it, try adding a dependency on the artifact(s) that implement the "mvn:"
protocol.  If you try this (adding pax-url-mvn version 1.1.2) and it
doesn't work, check 2 more things:

Run maven with the -X param ( mvn ....  -X ) and look at the debug info
to see what classpath was set up for the features-maven-plugin, and
insure it has the pax-url-mvn artifact.

And, also, check that the pax-url-mvn artifact does indeed provide the
"mvn:" protocol implementation.

HTH.  -Marshall



On 5/9/2010 8:42 AM, Bengt Rodehav wrote:
> Thanks for you reply Marshal,
>
> I've tried to add the artifacts pax-url-mvn and pax-url-commons as
> extensions as follows:
>
>   <build>
>     <extensions>
>       <extension>
>         <groupId>org.ops4j.pax.url</groupId>
>         <artifactId>pax-url-mvn</artifactId>
>         <version>1.1.2</version>
>       </extension>
>       <extension>
>         <groupId>org.ops4j.pax.url</groupId>
>         <artifactId>pax-url-commons</artifactId>
>         <version>1.1.2</version>
>       </extension>
>     </extensions>
> ...
>
> I also added
>
>         <extensions>true</extensions>
>
>  to the configuration of the features-maven-plugin.
>
> However, there is no difference. I still get
>
> "unknown protocol: null"
>
> I also note that I was wrong in my previous post. The
> features-maven-plugin does not work under the 3.0-alpha-7 either.
> Seems like the problem has to do with maven 3, and possibly the class
> loading changes that you mentioned. Just can't get it to work though.
> Any more ideas?
>
> /Bengt
>
>
> 2010/5/8 Marshall Schor <[email protected]>:
>   
>>
>> On 5/8/2010 2:55 AM, Bengt Rodehav wrote:
>>     
>>> No one has any ideas?
>>>
>>>       
>> Here's an idea - Maven 3 has been doing more class loader isolation
>> stuff.  Perhaps an <extensions> element is needed? See
>> https://cwiki.apache.org/MAVEN/maven-3x-class-loading.html
>>
>> -Marshall
>>     
>>> I'm thinking along the lines that something that wasn't bundled with
>>> maven alpha is now bundled with maven beta. Something that takes
>>> precedence over what's need for customised url handlers to work. Does
>>> anyone know if something has changed in that respect from the alpha to
>>> the beta version that could break url handlers.
>>>
>>> /Bengt
>>>
>>> 2010/5/7 Bengt Rodehav <[email protected]>:
>>>
>>>       
>>>> I'm using the features-maven-plugin included in Apache Felix. It in
>>>> turn uses "pax-url-mvn" (version 1.1.2) to enable the protocol "mvn:".
>>>>
>>>> This works fine in maven 2.2.1 and also in maven 3.0-alpha-7. However,
>>>> with everything else the same, it fails under maven 3.0-beta-1. I get
>>>>
>>>>  "java.net.MalformedURLException: unknown protocol: null"
>>>>
>>>> This happens in a call to "uri.toURL()" where the uri is created from
>>>> the string: 
>>>> "mvn:org.apache.felix.karaf/apache-felix-karaf/1.4.0/xml/features"
>>>>
>>>> It seems that the combination of pax-url-mvn and and maven 3.0-beta-1
>>>> does not work. Has anyone got any ideas as to what is wrong and
>>>> possibly a workaround?
>>>>
>>>> /Bengt
>>>>
>>>>
>>>>         
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>>     
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to