我无法让Karaf 3.0.0-RC1使用.m2 / settings.xml。以下是我在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
在我的settings.xml中,我定义了服务器,存储库(与上面没有@id的值相同)和代理。
在Karaf,当我重新添加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/)
我已经更改了实际的存储库,应用程序名称等,所以请忽略任何拼写错误,它们不应该相关。我错过了什么?
提前感谢您的帮助。
修改
我也在我的日志中看到了这一点,即使我有这个设置,似乎也在调用以太org.ops4j.pax.url.mvn.disableAether=true
这是日志的片段
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)
答案 0 :(得分:1)
我认为问题是你的设置disableAether = true。这样你就告诉karaf不要使用默认的maven分辨率。 (Aether是来自maven的库,用于解决伪影问题。
你有什么理由设置这个吗?