在Karaf中添加新的mvn url失败,repo spec为空

时间:2016-09-25 12:48:46

标签: osgi apache-karaf karaf

我在我当地的Karaf 4.0.2安装中的mvn.cfg文件中添加了一个新的mvn url,如下所示:

  

org.ops4j.pax.url.mvn.repositories = \       http://repo1.maven.org/maven2@id=central,\       http://repository.springsource.com/maven/bundles/release@id=spring.ebr.release,   \       http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external,   \       http://zodiac.springsource.com/maven/bundles/release@id=gemini,\       http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases,   \       https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@noreleases,   \       https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases,   \       http://repository.springsource.com/maven/bundles/external@id=spring-ebr-repository@snapshots@noreleases,   \ http://jenkins:8081/artifactory/simple/repo/@id=central,\
    http://artifactory.lsp.axiell.com/artifactory/maven-central@id=central,   \     http://artifactory.lsp.axiell.com/artifactory/libs-snapshot-release@snapshots

基本上我现在感兴趣的是@snapshots的最后一个。它包含一个功能xml,它指定了我想在本地karaf中安装的包。回购在其他地方。

当我在karaf控制台中输入以下内容时:

功能:repo-add mvn:com.axiell.lsp.integrations / utils / 1.0-SNAPSHOT / xml / features

我收到错误: karaf @根()>功能:repo-add mvn:com.axiell.lsp.integrations / utils / 1.0-SNAPSHOT / xml / features 添加功能url mvn:com.axiell.lsp.integrations / utils / 1.0-SNAPSHOT / xml / features 执行命令时出错:存储库规范为空字符串。 :mvn:com.axiell.lsp.integrations / utils / 1.0-SNAPSHOT / xml / features

这是日志中的堆栈跟踪。

,framework=org.apache.felix.framework,uuid=a1dc4a95-fb3b-440d-a6fd-e458f91bedbb
2016-09-25 14:36:49,195 | ERROR | nsole user karaf | ShellUtil                        | 45 - org.apache.karaf.shell.core - 4.0.2 | Exception caught while executing command
java.io.IOException: Repository spec is empty string. : mvn:com.axiell.lsp.integrations/utils/1.0-20160925.111911-1/xml/features
        at org.apache.karaf.features.internal.service.RepositoryImpl.load(RepositoryImpl.java:85)[8:org.apache.karaf.features.core:4.0.2]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.loadRepository(FeaturesServiceImpl.java:391)[8:org.apache.karaf.features.core:4.0.2]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.addRepository(FeaturesServiceImpl.java:411)[8:org.apache.karaf.features.core:4.0.2]
        at org.apache.karaf.features.command.RepoAddCommand.doExecute(RepoAddCommand.java:50)[32:org.apache.karaf.features.command:4.0.2]
        at org.apache.karaf.features.command.FeaturesCommandSupport.execute(FeaturesCommandSupport.java:37)[32:org.apache.karaf.features.command:4.0.2]
        at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:67)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:87)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:268)[45:org.apache.karaf.shell.core:4.0.2]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_71]
Caused by: shaded.org.ops4j.lang.NullArgumentException: Repository spec is empty string.
        at shaded.org.ops4j.lang.NullArgumentException.validateNotEmpty(NullArgumentException.java:109)
        at org.ops4j.pax.url.mvn.internal.config.MavenRepositoryURL.<init>(MavenRepositoryURL.java:94)[7:org.ops4j.pax.url.mvn:2.4.3]
        at org.ops4j.pax.url.mvn.internal.config.MavenConfigurationImpl.getRepositories(MavenConfigurationImpl.java:315)[7:org.ops4j.pax.url.mvn:2.4.3]
        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.selectRepositories(AetherBasedResolver.java:349)[7:org.ops4j.pax.url.mvn:2.4.3]
        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:523)[7:org.ops4j.pax.url.mvn:2.4.3]
        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:506)[7:org.ops4j.pax.url.mvn:2.4.3]
        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:481)[7:org.ops4j.pax.url.mvn:2.4.3]
        at org.ops4j.pax.url.mvn.internal.Connection.getInputStream(Connection.java:123)[7:org.ops4j.pax.url.mvn:2.4.3]
        at java.net.URL.openStream(URL.java:1045)[:1.8.0_71]
        at org.apache.karaf.features.internal.service.RepositoryImpl.load(RepositoryImpl.java:80)[8:org.apache.karaf.features.core:4.0.2]
        ... 15 more
2016-09-25 14:36:56,109 | ERROR | nsole user karaf | ShellUtil                        | 45 - org.apache.karaf.shell.core - 4.0.2 | Exception caught while executing command
java.io.IOException: Repository spec is empty string. : mvn:com.axiell.lsp.integrations/utils/1.0-SNAPSHOT/xml/features
        at org.apache.karaf.features.internal.service.RepositoryImpl.load(RepositoryImpl.java:85)[8:org.apache.karaf.features.core:4.0.2]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.loadRepository(FeaturesServiceImpl.java:391)[8:org.apache.karaf.features.core:4.0.2]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.addRepository(FeaturesServiceImpl.java:411)[8:org.apache.karaf.features.core:4.0.2]
        at org.apache.karaf.features.command.RepoAddCommand.doExecute(RepoAddCommand.java:50)[32:org.apache.karaf.features.command:4.0.2]
        at org.apache.karaf.features.command.FeaturesCommandSupport.execute(FeaturesCommandSupport.java:37)[32:org.apache.karaf.features.command:4.0.2]
        at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:67)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:87)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)[45:org.apache.karaf.shell.core:4.0.2]
        at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:268)[45:org.apache.karaf.shell.core:4.0.2]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_71]
Caused by: shaded.org.ops4j.lang.NullArgumentException: Repository spec is empty string.
        at shaded.org.ops4j.lang.NullArgumentException.validateNotEmpty(NullArgumentException.java:109)
        at org.ops4j.pax.url.mvn.internal.config.MavenRepositoryURL.<init>(MavenRepositoryURL.java:94)[7:org.ops4j.pax.url.mvn:2.4.3]
        at org.ops4j.pax.url.mvn.internal.config.MavenConfigurationImpl.getRepositories(MavenConfigurationImpl.java:315)[7:org.ops4j.pax.url.mvn:2.4.3]
        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.selectRepositories(AetherBasedResolver.java:349)[7:org.ops4j.pax.url.mvn:2.4.3]
        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:523)[7:org.ops4j.pax.url.mvn:2.4.3]
        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:506)[7:org.ops4j.pax.url.mvn:2.4.3]
        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:481)[7:org.ops4j.pax.url.mvn:2.4.3]
        at org.ops4j.pax.url.mvn.internal.Connection.getInputStream(Connection.java:123)[7:org.ops4j.pax.url.mvn:2.4.3]
        at java.net.URL.openStream(URL.java:1045)[:1.8.0_71]
        at org.apache.karaf.features.internal.service.RepositoryImpl.load(RepositoryImpl.java:80)[8:org.apache.karaf.features.core:4.0.2]
        ... 15 more

我已经尝试了所有可能的组合,但我总是得到错误存储库规范是空的。这可能是什么问题?提前谢谢。

3 个答案:

答案 0 :(得分:1)

您必须为maven存储库提供ID。尝试:

http://artifactory.lsp.axiell.com/artifactory/libs-snapshot-release@id=axiell@snapshots

答案 1 :(得分:1)

好的,这是一个奇怪的,但一个旧帖子给了我一个提示。基本上,其中一个mvn url在末尾有一个空格字符,可能搞砸了url的解析。删除网址可以解决问题。

http://osdir.com/ml/users-felix-apache/2009-11/msg00096.html

答案 2 :(得分:0)

https://ops4j1.jira.com/browse/PAXURL-333现已修复。额外的空格和逗号被丢弃。