Separate sets of system properties for production and development

38 views
Skip to first unread message

Partha Bhaumik

unread,
Mar 14, 2016, 8:39:14 PM3/14/16
to Google App Engine
I am trying to use two sets of system properties for an App Engine application. Is there a way to specify the development properties somewhere and the production properties somewhere else so that depending on the execution environment the correct set is loaded? I am new to App Engine, and this was easy to do in Play Framework using two .conf files.

I tried putting the dev properties in pom.xml under the jvm flags in the appengine-maven-plugin, and the production properties in appengine-web.xml. But when I am running "mvn appengine:devserver", the jvm flags are getting overwritten by the ones from appengine-web.xml.


Nick (Cloud Platform Support)

unread,
Mar 15, 2016, 11:03:36 AM3/15/16
to Google App Engine
Hey Partha,

A good question, but perhaps one that would best be asked on StackOverflow. This forum is meant for general discussion of the platform, not specific-issue technical support. Regardless, I'm happy to help with the beginnings of an answer:

1) You can detect whether you're in production or development programmatically using com.google.appengine.api.utils.SystemProperty.

2) You can also use maven's own feature of "Build Profiles" to have the system automagically insert the correct values for the correct environment through maven, rather than programmatically at servlet init, as suggested in 1).

I hope these resources are helpful to you! 

Sincerely,

Nick
Cloud Platform Community Support
Reply all
Reply to author
Forward
0 new messages