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é
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to