Hi Looks like you got it :). Only thing i can add is datasources don't need a resources.xml and are better configured outside the webapp, it also makes the overriding simpler since you don't need to prefix them with the webapp name too. Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn | JavaEE Factory 2017-06-06 16:30 GMT+02:00 Me Self : > Hi All > > How do I override configuration of JavaEE specific resources per > environment? Resources I need to override: > in web.xml > datasources and email resources in web.xml or in > resources.xml > > So far this is what I think could work: > - Inspired by Tomcat i guess an external config in > /conf/Catalina/localhost/.xml where would override > and would override could work? > - Probably TomEE specific solution of overriding /WEB-INF/resources.xml > properties with system properties -DmyResource...=...? > > The latter I found in a example to configure JavaMail on > openejb.apache.com. > Would this also work for datasources? And is there a similar way to > override the value of with system properties? > > What is the correct way to do this? >