我正在尝试在this guide之后构建Apache Karaf
的自定义分发版。我想要添加到我的发行版中的功能很少,因此我修改了pom.xml
文件,如下所示:
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>features-maven-plugin</artifactId>
<version>2.3.4</version>
<executions>
<execution>
<id>add-features-to-repo</id>
<phase>generate-resources</phase>
<goals>
<goal>add-features-to-repo</goal>
</goals>
<configuration>
<descriptors>
<descriptor>mvn:org.apache.karaf.assemblies.features/standard/2.3.2/xml/features</descriptor>
<descriptor>mvn:org.apache.camel.karaf/apache-camel/2.12.3/xml/features</descriptor>
<descriptor>mvn:io.hawt/hawtio-karaf/1.2.3/xml/features</descriptor>
</descriptors>
<features>
<feature>camel-ftp</feature>
<feature>camel-sql</feature>
<feature>camel-blueprint</feature>
<feature>hawtio</feature>
<feature>webconsole</feature>
</features>
</configuration>
</execution>
</executions>
</plugin>
此外,我修改了文件org.apache.karaf.features.cfg
以反映新功能:
#
# Comma separated list of features repositories to register by default
#
featuresRepositories=mvn:org.apache.karaf/apache-karaf/2.3.4/xml/features,mvn:org.apache.camel.karaf/apache-camel/2.12.3/xml/features,mvn:io.hawt/hawtio-karaf/1.2.3/xml/features
#
# Comma separated list of features to install at startup
#
featuresBoot=config,ssh,management,webconsole,camel-ftp,camel-blueprint,camel-sql,hawtio
另外,我想要默认安装几个jar,因为我修改了bin.xml
:
<!-- Copy over jar files -->
<fileSet>
<directory>lib/</directory>
<includes>
<include>lib1.jar</include>
<include>lib2.jar</include>
</includes>
<outputDirectory>/lib/</outputDirectory>
</fileSet>
一旦我准备好了所有内容,我就会运行mvn install
并使用我的自定义发行版获取tar.gz
文件,其中包含所有必需的文件。当我启动karaf并且运行features:list
并且没有安装任何内容时,我的问题出现了。即使您下载默认分发版,也不具备默认功能。我做错了什么?我还需要改变其他什么吗?
我的最终目标是拥有一个具有所有默认功能的自定义发行版: