简体   繁体   中英

app.yaml vs appengine-web.xml which one to use?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM