Marshall, I tried the explicit <dependencies><dependency> for the plugin already. No difference. Using the "-X" option was a good idea since you get a lot of information there. I can't see exactly what the plugin classpath looks like though. How do I determine that from the "-X" output?
I do get the following: [DEBUG] Created new class realm plugin>org.apache.felix.karaf.tooling:features-maven-plugin:1.5.0-SNAPSHOT [DEBUG] Populating class realm plugin>org.apache.felix.karaf.tooling:features-maven-plugin:1.5.0-SNAPSHOT [DEBUG] Included: org.apache.felix.karaf.tooling:features-maven-plugin:maven-plugin:1.5.0-SNAPSHOT [DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:1.5.1 [DEBUG] Included: junit:junit:jar:3.8.1 [DEBUG] Included: org.apache.felix:maven-bundle-plugin:jar:2.1.0-SNAPSHOT [DEBUG] Included: biz.aQute:bndlib:jar:0.0.357 [DEBUG] Included: net.sf.kxml:kxml2:jar:2.2.2 [DEBUG] Included: xmlpull:xmlpull:jar:1.1.3.1 [DEBUG] Included: org.apache.felix:org.apache.felix.bundlerepository:jar:1.5.0-SNAPSHOT [DEBUG] Included: org.osgi:org.osgi.core:jar:4.1.0 [DEBUG] Included: org.easymock:easymock:jar:2.4 [DEBUG] Included: org.apache.felix:org.osgi.core:jar:1.4.0 [DEBUG] Included: org.apache.felix:org.osgi.service.obr:jar:1.0.1 [DEBUG] Included: org.apache.maven:maven-archiver:jar:2.2 [DEBUG] Included: org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-7 [DEBUG] Included: org.apache.maven.shared:maven-dependency-tree:jar:1.2 [DEBUG] Included: org.apache.felix.karaf.features:org.apache.felix.karaf.features.core:jar:1.5.0-SNAPSHOT [DEBUG] Included: org.apache.felix.karaf:org.apache.felix.karaf.commons:jar:1.5.0-SNAPSHOT [DEBUG] Included: org.apache.felix.karaf.shell:org.apache.felix.karaf.shell.console:jar:1.5.0-SNAPSHOT [DEBUG] Included: jline:jline:jar:0.9.95.20100209 [DEBUG] Included: org.fusesource.jansi:jansi:jar:1.2 [DEBUG] Included: org.apache.aries.blueprint:org.apache.aries.blueprint:jar:0.1-incubating-SNAPSHOT [DEBUG] Included: org.apache.aries:org.apache.aries.util:jar:0.1-incubating-SNAPSHOT [DEBUG] Included: org.slf4j:slf4j-api:jar:1.4.3 [DEBUG] Included: org.apache.felix.gogo:org.apache.felix.gogo.runtime:jar:0.2.2 [DEBUG] Included: org.apache.felix.gogo:org.apache.felix.gogo.commands:jar:0.2.2 [DEBUG] Included: org.apache.felix.karaf.shell:org.apache.felix.karaf.shell.obr:jar:1.5.0-SNAPSHOT [DEBUG] Included: org.ops4j.pax.url:pax-url-mvn:jar:1.1.2 [DEBUG] Excluded: org.apache.maven:maven-plugin-api:jar:2.0.9 [DEBUG] Excluded: org.apache.maven:maven-project:jar:2.0.9 [DEBUG] Excluded: org.apache.maven:maven-settings:jar:2.0.9 [DEBUG] Excluded: org.apache.maven:maven-model:jar:2.0.9 [DEBUG] Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1 [DEBUG] Excluded: classworlds:classworlds:jar:1.1-alpha-2 [DEBUG] Excluded: org.apache.maven:maven-profile:jar:2.0.9 [DEBUG] Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.9 [DEBUG] Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.9 [DEBUG] Excluded: org.apache.maven:maven-artifact:jar:2.0.9 [DEBUG] Excluded: org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2 [DEBUG] Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.9 [DEBUG] Configuring mojo org.apache.felix.karaf.tooling:features-maven-plugin:1.5.0-SNAPSHOT:add-features-to-repo from plugin realm ClassRealm[plugin>org.apache.felix.karaf.tooling:features-maven-plugin:1.5.0-SNAPSHOT, parent: ClassRealm[plexus.core, parent: null]] I interpret the above as the classpath and it includes the pax-url-mvn jar. Just to be sure I modified the source code for the features-maven-plugin so that it actually instantiates the handler (org.ops4j.pax.url.mvn.Handler) - this works fine. Thus, it seems like the handler class is available but the JVM hasn't picked it up as a URL handler. I'm not sure how that mechanism works (I'll start studying the subject). I imagine the registration is done at JVM startup. At that time the handler class is probably not available. This seems like it could be a general problem in maven 3. Is that a difference in maven 3 compared to maven 2? Would the handler class be available to the JVM at startup in maven 2 (not sure I'm using the corret terminology here but I hope you understand)? /Bengt 2010/5/9 Marshall Schor <m...@schor.com>: > 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 <m...@schor.com>: >> >>> >>> 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 <be...@rodehav.com>: >>>> >>>> >>>>> 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: users-unsubscr...@maven.apache.org >>>> For additional commands, e-mail: users-h...@maven.apache.org >>>> >>>> >>>> >>>> >>>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >>> For additional commands, e-mail: users-h...@maven.apache.org >>> >>> >>> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> >> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org