I'm not convinced that you have a different issue here, why would you try to install the war yourself? Karaf does it, or better Pax-Web does it if it's a osgi-fied war if it's a non-osgi war just add a webbundle: url-handler before the mvn: url-handler e.g.
<bundle>webbundle:mvn:org.planner/wab-sample/1.0.0-SNAPSHOT/war?webapp-context=planner</bundle> regards, Achim 2012/10/9 Guofeng Zhang <guof...@avaya.com>: > Sorry, in the following description, It should be "track the bundle using > BundleTracker", not "ServerTracker". Typo. > > -----Original Message----- > From: Guofeng Zhang > Sent: Tuesday, October 09, 2012 3:57 PM > To: General OPS4J > Subject: RE: Can pax-url has service to resolve "mvn:" to the path to the > artifact in the local respository > > Achim, > > Thanks for your quick response. > > Let me describe my case. > > My bundle deployed on Karaf using the feature file. In the feature file, the > bundle is referenced using "mvn:" protocol, like > "mvn:org.planner/wab-sample/1.0.0-SNAPSHOT/war". > > I track the bundle using a ServiceTracker. In the ServiceTracker, I need to > know where the bundle is stored in the maven local repository: > String loc = bundle.getLocation() ; But the value of loc is what > defined in the feature file, that is, it is in the format of > "mvn:org.planner/wab-sample/1.0.0-SNAPSHOT/war". > > What I need is the path of > C:\.m2\repository\org\planner\wab-sample\1.0.0-SNAPSHOT\wab-sample-1.0.0-SNAPSHOT.war. > Using this path, I could let Jetty deploy the web bundle. That is, I need > the bundle's location in the local file system. > > I try if I could know in my code the path in the cache of Felix or Equinox, > but it seems that it is simpler to know how the "mvn:" URL is mapped > (downloaded) to the File path in the local repository.. > > Thanks. > > Guofeng > > > -----Original Message----- > From: general-boun...@lists.ops4j.org > [mailto:general-boun...@lists.ops4j.org] On Behalf Of Achim Nierbeck > Sent: Tuesday, October 09, 2012 3:16 PM > To: General OPS4J > Subject: Re: Can pax-url has service to resolve "mvn:" to the path to the > artifact in the local respository > > Hi Guofeng, > > I'm not sure I follow your question. > If you use the mvn: URL-connection you are bound to the way maven resolves > it's artefacts, so if you have a local maven-repo it'll get it's artifacts > from there. > If you are in need to resolve a jar / bundle from a file location you're able > to use the file: URL-Handler. > > regards, Achim > > 2012/10/9 Guofeng Zhang <guof...@avaya.com>: >> Hi, >> >> >> >> pax-url-aether or pax-url-commons has a URLStreamHandlerService >> implementation, which can resolve the "mvn:" url to a URLConnection. >> >> >> >> But what I need is to resolve the "mvn:" url to the path to the file >> located in the local maven repository, that is, resolve it to a File >> type, so that I could get the path string. >> >> >> >> Is it supported in the current codebase? >> >> >> >> Thanks >> >> >> >> Guofeng >> >> >> >> >> _______________________________________________ >> general mailing list >> general@lists.ops4j.org >> http://lists.ops4j.org/mailman/listinfo/general >> > > > > -- > > Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web > <http://wiki.ops4j.org/display/paxweb/Pax+Web/> > Committer & Project Lead > OPS4J Pax for Vaadin > <http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter & Project Lead > blog <http://notizblog.nierbeck.de/> > > _______________________________________________ > general mailing list > general@lists.ops4j.org > http://lists.ops4j.org/mailman/listinfo/general > > _______________________________________________ > general mailing list > general@lists.ops4j.org > http://lists.ops4j.org/mailman/listinfo/general -- Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter & Project Lead blog <http://notizblog.nierbeck.de/> _______________________________________________ general mailing list general@lists.ops4j.org http://lists.ops4j.org/mailman/listinfo/general