正如用户邮件列表中提到的,这是一个已知问题,但可以使用配置文件来解决。通过定义多个配置文件,管理服务工厂也可以与功能定义一起使用:
<feature name="persistence" version="1.0.0-SNAPSHOT" description="MongoDB Persistence">
<configfile finalname="/etc/org.amdatu.mongo-kairos.cfg">
mvn:groupId/persistency-config/version/cfg
</configfile>
<configfile finalname="/etc/org.amdatu.mongo-suez.cfg">
mvn:groupId/artifactId/versionId/jar
</configfile>
//.. a list of bundles
</feature>
此外,将配置文件与 maven 一起使用允许与应用程序一起对配置进行版本控制:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<id>persistency-config</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>${project.groupId}</groupId>
<artifactId>persistency-config</artifactId>
<version>${project.version}</version>
<packaging>cfg</packaging>
<file>config/org.amdatu.mongo-kairos.cfg</file>
</configuration>
</execution>
</executions>
</plugin>