문제

I am having trouble getting Karaf 3.0.0-RC1 to use .m2/settings.xml. Here are the settings I changed in org.ops4j.pax.url.mvn.cfg

org.ops4j.pax.url.mvn.proxySupport=true 
org.ops4j.pax.url.mvn.disableAether=true 
org.ops4j.pax.url.mvn.defaultRepositories= \ 
   http://my-repository.com/nexus/content/groups/my-group@id=my-group@snapshots

In my settings.xml, I defined servers, repositories (same value as above without @id, etc) and proxies.

In Karaf, when I repo-add mvn:my-repository.com/my-app/0.6.0.SNAPSHOT/xml/features

Adding feature url mvn:my-repository.com/my-app/0.6.0.SNAPSHOT/xml/features 
Error executing command: Error resolving artifact 
my-repository.com:my-app:xml:features:0.6.0.SNAPSHOT: 
Could not find artifact my-repository.com:my-app:xml:features:0.6.0.SNAPSHOT 
in defaultlocal (file:/var/karaf/.m2/repository/) 

I have changed the actual repository, app name, etc so please ignore any typos, they shouldn't be relevant. What am I missing?

Thanks in advance for your help.

EDIT I also saw this in my log, it seems like aether is being called even though I have this setting org.ops4j.pax.url.mvn.disableAether=true

Here's a snippet of the log

org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact my-repository.com:my-app:xml:features:0.6.0.SNAPSHOT in defaultlocal (file:/var/karaf/.m2/repository/) 
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538) 
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216) 
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193) 
        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:286) 
        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:250) 
        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolveFile(AetherBasedResolver.java:239) 
        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:223) 
        at org.ops4j.pax.url.mvn.internal.Connection.getInputStream(Connection.java:122) 
도움이 되었습니까?

해결책

I think the problem is your setting disableAether=true. This way you tell karaf to not use default maven resolution. (Aether is the library from maven that does artifact resolution.

Is there any reason why you set this?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top