首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Apache的特性-maven-plugin:create-kar在使用PAX wrap/bnd语法的features.xml包上失败

Apache的特性-maven-plugin:create-kar在使用PAX wrap/bnd语法的features.xml包上失败
EN

Stack Overflow用户
提问于 2013-03-13 00:49:43
回答 1查看 1.1K关注 0票数 1

有问题的行是这个特性片段中的第一个包。

代码语言:javascript
复制
<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目标在以下错误中失败:

代码语言:javascript
复制
[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

这似乎是错误地解析了包元素文本,并将包装器作为版本号的一部分。

代码语言:javascript
复制
<bundle>wrap:mvn:org.springframework/ldap/1.3.0.RELEASE,mvn:com.mycompany.stuff/stuff-common-security/1.0-SNAPSHOT/bnd/spring-ldap</bundle>

Karaf本身就像蛤蜊一样,对这个包语法很满意,所以我不认为我犯了错误。

有其他方法可以表达这一点吗?这样我就不会从create中得到这个错误了?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-03-27 00:29:20

尝试用'\‘或使用CDATA部分转义逗号(我在邮寄名单上注意到了一些转义问题):

代码语言:javascript
复制
<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协议,所以建议将错误归档

在使用分类器时,您可能只想在stuff-common-security的pom中进行嵌入,但这可能会使您的构建过于毛茸茸的]。

如果是这样,则创建一个仅以这两个模块为依赖项的maven模块,然后使用BND/maven-bundle-plugin的嵌入依赖关系将它们合并。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15375077

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档