8
votes

I am using Google App Engine flexible to deploy my spring boot app. I see the configuration can be specified by app.yaml or appengine-web.xml. However, my questions are,

  1. Which configuration file should I use for the Spring boot app, yaml or xml?
  2. If xml, should I create web/WEB-INF/ folder and place the appengine-web.xml under that?
  3. Also, if xml how to specify the "flex" environment choice (via which property) in the xml?

Thanks in advance.

1
In my oppinion, I think you should use xml file as static configuration with less changing because xml syntax is complex. And use yaml file for application properties which sequense changing. Yaml format is human readable. - Bui Anh Tuan
I think the yaml configuration is ignored if the xml configuration is present? - KayKay
I doubt that - none of the 2 config files completely covers all parameters covered by the other one. They're rather complementing each-other. - Dan Cornilescu

1 Answers

3
votes

You need to use both files.

The app.yaml file covers configurations applicable to all flexible environment apps/services, regardless of the language they're written in, like:

The web.xml config file has a very specific coverage, which doesn't overlap the app.yaml file's coverage:

The web.xml file is only used when deploying a Java app to a runtime that includes the Jetty9/servlet3 server. For more details, see the Java 8 / Jetty 9.3 Runtime.

As for your #2 question, you may have been looking at the standard env docs (check the docs/standard or docs/flexible strings in the doc's URL). From web.xml:

This file is named web.xml, and resides in the app's WAR under the WEB-INF/ directory. web.xml is part of the servlet standard for web applications.