在karaf org.apache.karaf.features.cfg文件中
我已经添加了
featuresRepositories=mvn:org.apache.cxf.karaf/apache-cxf/3.0.8/xml/features
featuresBoot = cxf-jaxws
当karaf使用连接启动时,可以获取并安装cxf功能。
但是没有连接就会失败,如何预装cxf功能?
发布于 2021-10-18 08:18:27
这可能远不是最好的解决方案(我很想听听更好的解决方案),但你可以使用karaf-feature-archetype创建离线存储库项目,并使用如下配置配置karaf-maven-plugin:
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
<configuration>
<startLevel>50</startLevel>
<aggregateFeatures>true</aggregateFeatures>
<checkDependencyChange>true</checkDependencyChange>
<failOnDependencyChange>false</failOnDependencyChange>
<logDependencyChanges>true</logDependencyChanges>
<overwriteChangedDependencies>true</overwriteChangedDependencies>
</configuration>
<executions>
<execution>
<id>features-add-to-repo</id>
<phase>generate-resources</phase>
<goals>
<goal>features-add-to-repository</goal>
</goals>
<configuration>
<descriptors>
<!-- Feature repository paths -->
<descriptor>mvn:groupId/artifactId/version/xml/features</descriptor>
</descriptors>
<features>
<!-- features and their artifacts + dependencies to add to offline repository-->
<feature>featureName</feature>
<feature>featureName/version</feature>
</features>
<repository>target/offline-repository</repository>
</configuration>
</execution>
</executions>
</plugin>当使用命令maven clean install打包项目时(在具有在线访问的环境中),它将在目标文件夹下生成离线存储库,您可以将其复制到您的离线环境中,并通过将其添加到文件org.ops4j.pax.url.mvn.cfg中的org.ops4j.pax.url.mvn.defaultRepositories中来告诉karaf使用它,如果它位于主目录中,即file:${user.home}/offline-repository@snapshots@id=local。
features.xml本身可以是空的,这只是为了使用karaf-maven-plugin,而不是创建一个实际的特性存储库。
如果您需要创建一个新版本的离线存储库来替换旧版本,请务必小心。如果新版本缺少当前安装到karaf的任何工件,则在尝试删除/卸载它们时可能会导致问题。
https://stackoverflow.com/questions/69189739
复制相似问题