I'd recommend you to take the InputStream from URL and pass it to whereever
you like (store to disk if you need to).
This is extra work but it makes your code agnostic to where the Stream is
comes from. Depending on Aether (the base of our mvn url handler
implementation) you might not even have it cached locally at that point in
time - and you should not care.
-- of cause, currently it IS cached in the local maven repo but its rather
a side effect than something you should use to build functionality on top
of. Way too brittle.


Toni Menzel | Founder | Rebaze GmbH
toni.men...@rebaze.com | www.rebaze.com
Access To Alien Technology: Great software needs a great foundation. We
help unlocking the next level in technology.
Rebaze Pass for Maven <http://goo.gl/1YLlt>, Rebaze Pass for
OSGi<http://goo.gl/WP8XT>
, Rebaze Pass for Neo4j <http://www.rebaze.com/services/>, Rebaze Pass for
Jenkins <http://www.rebaze.com/services/>



On Tue, Oct 9, 2012 at 10:12 AM, Guofeng Zhang <guof...@avaya.com> wrote:

> Pax-Web just released the support for 8.1.x. it seems that is does not
> interpret Jetty's configuration file fully. So in our application, we use
> Jetty's OSGI boot to deploy wab or web application.
>
> -----Original Message-----
> From: general-boun...@lists.ops4j.org [mailto:
> general-boun...@lists.ops4j.org] On Behalf Of Achim Nierbeck
> Sent: Tuesday, October 09, 2012 4:08 PM
> To: General OPS4J
> Subject: Re: Can pax-url has service to resolve "mvn:" to the path to the
> artifact in the local respository
>
> 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
>
> _______________________________________________
> 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

Reply via email to