How to Implement Spring Profiles in Jmix Add-on Modules

I’m developing a Jmix add-on module and need to implement Spring profiles that are entirely self-contained within the add-on. The active profile should be determined by the add-on’s own module.properties file.

Goal:

  • Add-on should independently manage its profiles via module.properties
  • No dependency on the main application’s profile configuration
  • Profile-specific properties should load automatically

Hi,

Can you add more details about what you want to achive or solve and why standard Spring profiles is not suitable? Describe you expected scenario - where do you expect to specify some values and how it should affect (or not) your application or part of it.

As I understand you want to emulate Spring profiles functionality, but it should affect only specific module so even if the “main” application profile is set to some <app_profile> you expect your module uses some <module_profile> specified in some custom property (with default one specified in module.properties).
Correct me if I’m wrong.

For now it doesn’t look like something Jmix-specific feature.
I can suggest you to check @ConditionalOn... beans declaration or use some more specific names of standard Spring profiles like module-name-x, module-name-y and use them only in your module (you can activate multiple profiles at once so it can be some “main” profile together with your “module” profile).

Regards,
Ivan