2013-03-13 35 views
0

该问题的行是第一在该特征代码段阿帕奇OSGI Karaf的特征-行家-插件:CREATE-KAR是在features.xml束使用PAX包裹/ BND语法失败

<feature name="stuff-common-security"> 
    <bundle>wrap:mvn:org.springframework/ldap/1.3.0.RELEASE,mvn:com.mycompany.stuff/stuff-common-security/1.0-SNAPSHOT/bnd/spring-ldap</bundle> 
    <bundle>mvn:org.springframework.security/spring-security-core/3.1.0.RELEASE</bundle> 
    <bundle>mvn:org.springframework.security/spring-security-ldap/3.1.0.RELEASE</bundle> 
    <bundle>mvn:com.mycompany.stuff/stuff-common-security/1.0-SNAPSHOT</bundle> 
</feature> 

在创建-KAR目标失败,此错误:

[ERROR] Failed to execute goal org.apache.karaf.tooling:features-maven-plugin:2.2.9:create-kar (create-kar) on project stuff-demo: 
Failed to create kar archive: 
Could not find artifact org.springframework:ldap:stuff-common-security:1.0-SNAPSHOT:1.3.0.RELEASE,mvn:com.mycompany.stuff 
in maven.mycompany.com (http://maven.mycompany.com/artifactory/libs-release-local) 
[ERROR] 
[ERROR] Try downloading the file manually from the project website. 
[ERROR] 
[ERROR] Then, install it using the command: 
[ERROR] mvn install:install-file -DgroupId=org.springframework -DartifactId=ldap 
     -Dversion=1.3.0.RELEASE,mvn:com.mycompany.stuff -Dclassifier=1.0-SNAPSHOT 
     -Dpackaging=stuff-common-security -Dfile=/path/to/file 

这似乎是misparsing是捆绑元素文本和处理包装的版本号的一部分。

<bundle>wrap:mvn:org.springframework/ldap/1.3.0.RELEASE,mvn:com.mycompany.stuff/stuff-common-security/1.0-SNAPSHOT/bnd/spring-ldap</bundle> 

卡拉夫本身很喜欢这个捆绑语法的蛤,所以我不认为我在那里犯了一个错误。

有没有其他的方法可以表达这个,所以我不会从create-kar中得到这个错误?

回答

1

尝试逃避逗号,“\”或者使用CDATA部分(我有一些逃避的问题上mailing list指出):

<bundle><![CDATA[ 
wrap:mvn:org.springframework/ldap/1.3.0.RELEASE,mvn:com.mycompany.stuff/stuff-common-security/1.0-SNAPSHOT/bnd/spring-ldap 
]]></bundle> 

如果不行 - 我怀疑该插件不使用实际的URL处理程序和刚刚剥离的wrap协议,因此,只要您使用您可能希望只是做POM中嵌入了stuff-common-security分类建议filing a bug

,但可能使您的构建有点太毛茸茸的=]

如果是这样创建一个只有这两个模块作为依赖项的maven模块,那么使用BND/maven-bundle-plugin的embed dependencies来合并它们。