Hi,

you can do this by using the slingfeature maven plugin and creating an aggregate per environment.
https://github.com/apache/sling-slingfeature-maven-plugin#aggregate-features

For each aggregate you create you choose a new classifier name and list the classifiers of the features you want to include.

Regards
Carsten

Am 29.10.2019 um 18:10 schrieb Björn Weide:
Hi all,

I recently tried to create a simple OSGi (non-Sling) based app using the
Sling Feature Model. This works very well, but I was wondering about the
best way to simulate Sling Runmodes in such a setup (I somehow couldn't
find a hint on that in the current documentation of the Feature Model).

Currently I splitted the configuration of the app in a global feature and a
couple of environment-specific ones. I deployed all configurations into the
repository and then started the app with multiple feature files given (one
defining the server - bundles and server configuration, one containing the
global app configuration and one for the respective environment-specific
configuration).

This approach works, but I was wondering how to build the artifacts
correctly. I placed all configurations in a dedicated Maven module and
wanted to generate a feature per environment so that all config features
have the same group/artifact but individual classifiers. My structure
looked like this
- global.json = global app configuration feature
- production.json = env-specific configuration feature for "production"
runmode
- test.json = another env-specific configuration feature for "test" runmode

Unfortunately it couldn't figure out how to generate a feature from a given
feature file with a given classifier only - not sure if this is supported.
I got my setup working by only aggregate a feature with the global.json
feature file - the other 2 feature files were automatically generated
during the build with the classifier = filename. So this nicely worked, but
I am not sure if this is a bug or a feature.

What would be the correct approach for such a setup?

Best regards,
Bjoern


--
--
Carsten Ziegeler
Adobe Research Switzerland
[email protected]

Reply via email to