You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Benjamin Debeerst <Be...@gmx.de> on 2012/11/05 18:05:40 UTC

Pax url does not use maven settings

Hello,

I am trying to get the maven url resolution working within my karaf installation to provide my application as feature.xml. I encounter 1) a problem and 2) have a question. I'm not actually shure if this or the pax mailing list is the correct one to post this question to, but I hope someone here can help me.

1) As I have maven installed locally with the appropriate settings (with a nexus as proxy), it seems natural to me to have karaf / pax url use those settings instead of specifying the repo a second time. But it does not seem to find (or use) my settings. As I tested, the maven settings are setup correctly since I can download artifacts from the configured nexus.

I basically stripped down the org.ops4j.pax.url.mvn.cfg to use the local maven settings only:

org.ops4j.pax.url.mvn.settings=/home/debeerstb/.m2/settings.xml
#org.ops4j.pax.url.mvn.localRepository=
org.ops4j.pax.url.mvn.useFallbackRepositories=false
# org.ops4j.pax.url.mvn.proxySupport=false
org.ops4j.pax.url.mvn.disableAether=true
org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/${karaf.default.repository}@snapshots,
file:${karaf.home}/local-repo@snapshots
org.ops4j.pax.url.mvn.repositories=

Although the first property should not be necessary in the first place, since it is the standard directory where pax should look anyways. Trying to intstall my features results in:

Error executing command: URL [mvn:<groupId>/<artifactId>/<version>] could not be resolved.

When I explicitely add my nexus url to org.ops4j.pax.url.mvn.repositories, the resolution works fine.

2) When resolving mvn resources succeeds, these artifacts are not put to my local maven repo. (I would like that to happen, such that a re-deployment of that feature is faster.) Is this a feature or a bug? Or may it be caused by 1) ?

Thanks a lot,
Benjamin

Re: Pax url does not use maven settings

Posted by Benjamin Debeerst <Be...@gmx.de>.
Hello JB,

thanks for the incredibly fast answer. The clarification on pax using only the settings.xml did a lot. Indeed I did rely on pax url using the repo / mirror settings. Setting the default repositories for pax url (or simply pax url's repositories setting) did the job though.

As for karaf 3.0.x, is there an idea about when it is going to be released? I'd love to have that local repository population feature :-)

Best,
Benjamin

-------- Original-Nachricht --------
> Datum: Mon, 05 Nov 2012 18:15:56 +0100
> Von: "Jean-Baptiste Onofré" <jb...@nanthrax.net>
> An: user@karaf.apache.org
> Betreff: Re: Pax url does not use maven settings

> Hi Benjamin,
> 
> 1/ pax url doesn't use your local Maven installation, just the 
> settings.xml (defined as $HOME/.m2/settings.xml so, it's important that 
> the user that launch Karaf provide this settings.xml, else you have to 
> provide the patch to the settings.xml). However, depending of the Karaf 
> version, the behavior could be different.
> Karaf 2.2.x and 2.3.x use pax-url-mvn, whereas Karaf 3.0.x uses 
> pax-url-aether.
> 
> However, some configuration from settings.xml are not used by Pax Url. 
> It's the case for <mirror/>, <repositories/>, etc. That's why you have 
> to use defaultRepositories (adding your repo), using pax-url-mvn.
> 
> 2/ it's "normal" with Karaf 2.2.x and 2.3.x. With Karaf 3.0.x, you will 
> be able to populate your local repo (and completely avoid the usage of 
> the system repo for instance).
> 
> Regards
> JB
> 

Re: Pax url does not use maven settings

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Benjamin,

1/ pax url doesn't use your local Maven installation, just the 
settings.xml (defined as $HOME/.m2/settings.xml so, it's important that 
the user that launch Karaf provide this settings.xml, else you have to 
provide the patch to the settings.xml). However, depending of the Karaf 
version, the behavior could be different.
Karaf 2.2.x and 2.3.x use pax-url-mvn, whereas Karaf 3.0.x uses 
pax-url-aether.

However, some configuration from settings.xml are not used by Pax Url. 
It's the case for <mirror/>, <repositories/>, etc. That's why you have 
to use defaultRepositories (adding your repo), using pax-url-mvn.

2/ it's "normal" with Karaf 2.2.x and 2.3.x. With Karaf 3.0.x, you will 
be able to populate your local repo (and completely avoid the usage of 
the system repo for instance).

Regards
JB

On 11/05/2012 06:05 PM, Benjamin Debeerst wrote:
> Hello,
>
> I am trying to get the maven url resolution working within my karaf installation to provide my application as feature.xml. I encounter 1) a problem and 2) have a question. I'm not actually shure if this or the pax mailing list is the correct one to post this question to, but I hope someone here can help me.
>
> 1) As I have maven installed locally with the appropriate settings (with a nexus as proxy), it seems natural to me to have karaf / pax url use those settings instead of specifying the repo a second time. But it does not seem to find (or use) my settings. As I tested, the maven settings are setup correctly since I can download artifacts from the configured nexus.
>
> I basically stripped down the org.ops4j.pax.url.mvn.cfg to use the local maven settings only:
>
> org.ops4j.pax.url.mvn.settings=/home/debeerstb/.m2/settings.xml
> #org.ops4j.pax.url.mvn.localRepository=
> org.ops4j.pax.url.mvn.useFallbackRepositories=false
> # org.ops4j.pax.url.mvn.proxySupport=false
> org.ops4j.pax.url.mvn.disableAether=true
> org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/${karaf.default.repository}@snapshots,
> file:${karaf.home}/local-repo@snapshots
> org.ops4j.pax.url.mvn.repositories=
>
> Although the first property should not be necessary in the first place, since it is the standard directory where pax should look anyways. Trying to intstall my features results in:
>
> Error executing command: URL [mvn:<groupId>/<artifactId>/<version>] could not be resolved.
>
> When I explicitely add my nexus url to org.ops4j.pax.url.mvn.repositories, the resolution works fine.
>
> 2) When resolving mvn resources succeeds, these artifacts are not put to my local maven repo. (I would like that to happen, such that a re-deployment of that feature is faster.) Is this a feature or a bug? Or may it be caused by 1) ?
>
> Thanks a lot,
> Benjamin
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com