I like to migrate an application from Java SE Spring Dependency-Injection using applicationContext-production.xml, applicationContext-devel.xml etc. files to Java EE CDI.
In Spring, I could include several configuration files with the jar and load one at application start (by parsing e.g. a command line parameter --config). So my first question is what would be the best practice to configure a "profile" in JavaEE? Can I somehow switch between web.xml.DEVEL and web.xml.PROD before the CDI dependency injection kicks in?
As I configured not only member objects (@Inject) but also attribute values (@Resource), I would not only have to switch between different beans.xml for different <alternatives> sections but also between different web.xml / ejb-jar.xml for the <env-entry> settings, right? Or should I use some kind of glassfish.xml to configure the settings inside the application container and then retrieve them all with @Resource(name="java:app/env/foo")?