我在这里看到了几个类似的问题,但这些问题要么没有得到答复,要么对我的案件没有提出相关的解决办法。我正在尝试使用karaf-maven-plugin构建一个maven项目。以下是POM的相关片段:
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
<version>${karaf.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>karaf-assembly</id>
<goals>
<goal>assembly</goal>
</goals>
<phase>install</phase>
</execution>
</executions>
<configuration>
<javase>11</javase>
<framework>framework</framework>
<useReferenceUrls>true</useReferenceUrls>
<archiveTarGz>false</archiveTarGz>
<includeBuildOutputDirectory>false</includeBuildOutputDirectory>
<installedBundles>
<installedBundle>mvn:commons-lang/commons-lang/2.6</installedBundle>
<installedBundle>mvn:org.apache.camel/camel-cxf/${camel.version}</installedBundle>
<installedBundle>mvn:org.apache.cxf/cxf-rt-frontend-jaxrs/3.4.0</installedBundle>
<installedBundle>mvn:javax.enterprise/cdi-api/2.0</installedBundle>
<installedBundle>mvn:javax.transaction/javax.transaction-api/1.2</installedBundle>
</installedBundles>
<bootFeatures>
<feature>bundle</feature>
<feature>config</feature>
<feature>diagnostic</feature>
<feature>feature</feature>
<feature>jaas</feature>
<feature>shell</feature>
<feature>log</feature>
<feature>management</feature>
<feature>package</feature>
<feature>shell-compat</feature>
<feature>ssh</feature>
<feature>system</feature>
<feature>wrap</feature>
<feature>scr</feature>
</bootFeatures>
<startupFeatures>
<feature>framework</feature>
<feature>aries-blueprint</feature>
<feature>camel-core</feature>
<feature>camel-blueprint</feature>
</startupFeatures>
<startupBundles>
<bundle>mvn:${project.groupId}/${project.artifactId}/${project.version};start-level=80</bundle>
</startupBundles>
</configuration>
</plugin>在尝试构建时,会引发以下异常:
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.2.8:assembly
(karaf-assembly) on project ...: Unable to build assembly: Unable to resolve root: missing
requirement [root] osgi.identity; osgi.identity=...; type=osgi.bundle; version="
[1.0.1,1.0.1]"; resolution:=mandatory [caused by: Unable to resolve press- release2/1.0.1:
missing requirement [press-release2/1.0.1] osgi.extender; beans=...; filter:="
(&(osgi.extender=osgi.cdi)(version>=1.0.0)(!(version>=2.0.0)))"] -> [Help 1]因此,很明显,没有安装用于CDI的OSGI扩展程序(osgi.cdi)。我可能应该将它添加到<bootFeatures/>或<startupFeatures/>中,但是:
<feature>cdi</feature>不会改变任何事情。在此之前,非常感谢您。
西摩
发布于 2020-11-05 15:44:40
我在问我自己的问题:为了修复上述异常,需要安装以下功能: pax-cdi,pax-cdi-焊缝,pax-cdi-web,pax-web-焊缝。你好,西摩
https://stackoverflow.com/questions/64621888
复制相似问题