Thanks for the answer! I'm using Karaf 3.0.1

I do have some thoughts after switching to config files. I've created config
folder next to the pom.xml and added following part into the build section:

<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>

And following entry in my features.xml

<configfile finalname="/etc/org.amdatu.mongo-kairos.cfg">
        mvn:groupId/persistency-config/version/cfg
</configfile>

I think that this is great, because it allows to keep several configurations
for different environments. (staging/prod) And, moreover - it keeps
different versions of configs along with versions of your app is it
develops!

This also made me to version the feature.xml as a separate maven project.
(with the usage of the very same maven plugin)



--
View this message in context: 
http://karaf.922171.n3.nabble.com/How-to-create-configuration-for-Managed-Service-Factory-with-Karaf-features-tp4034592p4034606.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to