英文:
Building repo with Karaf features-maven-plugin with CXF dependency causes infinite loop
问题
使用Karaf features-maven-plugin构建带有CXF依赖项的仓库会导致无限循环。
我正在使用org.apache.karaf.tooling/features-maven-plugin的版本2.3.12。
看起来这是在CXF版本3.2.x添加cxf-core和cxf-commands之间的循环依赖关系时开始发生的。
它会输出数百个这样的信息,然后抛出堆栈溢出异常:
[INFO] 添加功能的内容: cxf-core/3.2.14
[INFO] 添加功能的内容: cxf-commands/3.2.14
[INFO] 添加功能的内容: cxf-core/3.2.14
[INFO] 添加功能的内容: cxf-commands/3.2.14
这是我的pom文件中的插件部分:
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>features-maven-plugin</artifactId>
<version>2.4.4</version>
<extensions>true</extensions>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http-lightweight</artifactId>
<version>3.4.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>add-features-to-repo</id>
<phase>generate-resources</phase>
<goals>
<goal>add-features-to-repo</goal>
</goals>
<configuration>
<features>
<feature>cxf-core/3.2.14</feature>
</features>
</configuration>
</execution>
</executions>
</plugin>
以下是CXF功能中有问题的部分 - 请注意,“cxf-core”具有对“cxf-commands”功能的有条件依赖,而“cxf-commands”功能对“cxf-core”有硬依赖。这对我来说似乎是错误的,我看不到任何方法告诉插件不要陷入无限循环。
<feature name="cxf-core" version="3.2.14">
<feature version="3.2.14">cxf-specs</feature>
<bundle start-level="30" dependency="true">mvn:org.apache.ws.xmlschema/xmlschema-core/2.2.5</bundle>
<bundle start-level="25" dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/1.2_5</bundle>
<bundle start-level="30" dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.fastinfoset/1.2.13_1</bundle>
<bundle start-level="40">mvn:org.apache.cxf/cxf-core/3.2.14</bundle>
<bundle start-level="40">mvn:org.apache.cxf/cxf-rt-management/3.2.14</bundle>
<conditional>
<condition>shell</condition>
<feature version="3.2.14">cxf-commands</feature>
</conditional>
</feature>
<feature name="cxf-commands" version="3.2.14">
<feature>shell</feature>
<feature version="3.2.14">cxf-core</feature>
<bundle start-level="40">mvn:org.apache.cxf.karaf/cxf-karaf-commands/3.2.14</bundle>
</feature>
英文:
Building repo with Karaf features-maven-plugin with CXF dependency causes infinite loop.
I'm using version 2.3.12 of the org.apache.karaf.tooling/features-maven-plugin.
this seems to have started happening with CXF version 3.2.x when the circular-dependency was added between cxf-core and cxf-commands.
It outputs hundreds of these, then throws a stack overflow exception:
[INFO] Adding contents for feature: cxf-core/3.2.14
[INFO] Adding contents for feature: cxf-commands/3.2.14
[INFO] Adding contents for feature: cxf-core/3.2.14
[INFO] Adding contents for feature: cxf-commands/3.2.14
here is the pom plugin section of my pom:
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>features-maven-plugin</artifactId>
<version>2.4.4</version>
<extensions>true</extensions>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http-lightweight</artifactId>
<version>3.4.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>add-features-to-repo</id>
<phase>generate-resources</phase>
<goals>
<goal>add-features-to-repo</goal>
</goals>
<configuration>
<features>
<feature>cxf-core/3.2.14</feature>
</features>
</configuration>
</execution>
</executions>
</plugin>
here is the offending bit of the cxf features - notice that "cxf-core" has a conditional dependency on "cxf-commands" feature and "cxf-commands" feature has a hard dependency on "cxf-core". This seems WRONG to me and I don't see any way of telling the plugin to not get into an infinite loop.
<feature name="cxf-core" version="3.2.14">
<feature version="3.2.14">cxf-specs</feature>
<bundle start-level="30" dependency="true">mvn:org.apache.ws.xmlschema/xmlschema-core/2.2.5</bundle>
<bundle start-level="25" dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/1.2_5</bundle>
<bundle start-level="30" dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.fastinfoset/1.2.13_1</bundle>
<bundle start-level="40">mvn:org.apache.cxf/cxf-core/3.2.14</bundle>
<bundle start-level="40">mvn:org.apache.cxf/cxf-rt-management/3.2.14</bundle>
<conditional>
<condition>shell</condition>
<feature version="3.2.14">cxf-commands</feature>
</conditional>
</feature>
<feature name="cxf-commands" version="3.2.14">
<feature>shell</feature>
<feature version="3.2.14">cxf-core</feature>
<bundle start-level="40">mvn:org.apache.cxf.karaf/cxf-karaf-commands/3.2.14</bundle>
</feature>
答案1
得分: 1
好的,以下是翻译好的部分:
"well, as it turns out, the features-maven-plugin has been superseded. This plugin works!"
"事实证明,features-maven-plugin 已经被取代。这个插件有效!"
"simply change the goal to: features-add-to-repository and make sure the <repository> is set. this is the normal one:"
"只需将目标更改为:features-add-to-repository 并确保 <repository> 已设置。这是正常的设置:"
"<repository>target/features-repo</repository>"
"and, it recognizes and supports the conditional functionality!"
"而且,它识别并支持条件功能!"
英文:
well, as it turns out, the features-maven-plugin has been superseded. This plugin works!
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
simply change the goal to: features-add-to-repository and make sure the <repository> is set. this is the normal one:
<repository>target/features-repo</repository>
and, it recognizes and supports the conditional functionality!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论