感谢 KSobkowiak 的回答为我指明了正确的方向。我发布了我用来启动并运行自定义 ServiceMix 5.x 的步骤,以防其他人需要这样做。说明假设 Linux,但 windows 步骤应该类似。
1) 下载并解压 ServiceMix 和 Maven
cd /opt
unzip apache-servicemix-5.1.4.zip
unzip apache-maven-3.0.3.zip
2) 如果需要,配置maven proxy:
3) 创建一个maven项目目录
mkdir serviceMix_features
cd serviceMix_features
4) 使用以下 xml 创建一个 maven pom 文件。我通过在 servicemix 控制台中运行 features:listurl 命令获得了描述符列表。这些功能将是您自定义 servicemix 发行版中所需的任何功能,在这种情况下,我添加了 webconsole 和几个骆驼组件。
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>my.group</groupId>
<artifactId>custom-servicemix</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>My custom service mix repository</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>features-maven-plugin</artifactId>
<version>2.3.9</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.camel.karaf/apache-camel/2.13.3/xml/features</descriptor>
<descriptor>mvn:org.apache.servicemix/apache-servicemix/5.1.4/xml/internal</descriptor>
<descriptor>mvn:org.apache.activemq/activemq-karaf/5.10.0/xml/features</descriptor>
<descriptor>mvn:org.apache.karaf.assemblies.features/standard/2.3.9/xml/features</descriptor>
<descriptor>mvn:org.apache.karaf.assemblies.features/enterprise/2.3.9/xml/features</descriptor>
<descriptor>mvn:org.apache.jclouds.karaf/jclouds-karaf/1.7.2/xml/features</descriptor>
<descriptor>mvn:org.apache.cxf.karaf/apache-cxf/2.7.13/xml/features</descriptor>
<descriptor>mvn:org.apache.servicemix/apache-servicemix/5.1.4/xml/features</descriptor>
<descriptor>mvn:org.apache.servicemix/apache-servicemix/5.1.4/xml/examples</descriptor>
<descriptor>mvn:org.ops4j.pax.cdi/pax-cdi-features/0.8.0/xml/features</descriptor>
<descriptor>mvn:org.apache.activemq/activemq-karaf/5.10.0/xml/features-core</descriptor>
</descriptors>
<features>
<feature>webconsole</feature>
<feature>camel-restlet</feature>
<feature>camel-jackson</feature>
</features>
<repository>target/features-repo</repository>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
5) 执行 maven 项目。我注意到有时 maven 会部分通过并失败。重试后,我注意到它每次运行都会拉入额外的罐子,最后第四次尝试成功。
/opt/apache-maven-3.0.3/bin/mvn install
6) 在默认服务组合发行版上覆盖 maven 文件。
cp -Rvn target/features_repo/* /opt/apache-servicemix-5.1.4/system/
7) 压缩或压缩您的自定义服务组合发行版并将其移动到您需要的位置。如果您使用的是代理,您可以取消配置 maven 代理并清除您的 maven 存储库,以验证服务组合是否已从服务组合控制台正确更新。
features:install webconsole