2 Replies Latest reply on Nov 14, 2011 11:08 AM by Michael Bayer

    CDI configuration at runtime

    Michael Bayer Newbie

      Hi!


      I tried to google this, but I can't seem to find good search terms:


      I need to configure different @Alternatives, @Decorators and @Injectors for different runtime environments (think testing, staging and production servers).


      Right now I use maven to create three wars, and the only difference between those wars are in the beans.xml files. Is there a better way to do this? I do have @Alternative @Stereotypes for the different environments, but even then I need to alter beans.xml, and they don't work for @Decorators (or do they?)


      Is it somehow possible to instruct Weld to ignore the values in beans.xml and use a custom configuration source? Because then I could for example read a system property or other environment variable.


      thanks in advance for your time