11

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.

KayKay
  • 553
  • 7
  • 22
  • 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 Aug 22 '17 at 07:00
  • 1
    I think the yaml configuration is ignored if the xml configuration is present? – KayKay Aug 22 '17 at 14:05
  • 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 Aug 22 '17 at 14:22

1 Answers1

3

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.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
  • 5
    Sure. Yes, I am aware of the web.xml in the web apps. My question was focusing on appengine-web.xml which holds the specific configuration for app engines. – KayKay Aug 22 '17 at 15:58
  • 1
    I was referring to this xml and properties and please note few overlapping properties *https://cloud.google.com/appengine/docs/standard/java/config/appref?hl=en#Java_appengine_web_xml_System_properties_and_environment_variables*. So you mean that appengine-web.xml is only for app engine standard environment and flexible only uses app.yaml? – KayKay Aug 22 '17 at 16:05
  • Yep - standard env only. – Dan Cornilescu Aug 22 '17 at 16:10
  • Thanks for the prompt response. – KayKay Aug 22 '17 at 16:14
  • related: https://stackoverflow.com/questions/45842772/how-to-tell-if-a-google-app-engine-documentation-page-applies-to-the-standard-or/45842773#45842773 – Dan Cornilescu Aug 23 '17 at 14:48
  • I think the two files are equal in power. By the way, you can specify flex param in appengine-web.xml. Something messy, isn't it? :) – Aram Paronikyan Oct 25 '17 at 14:48
  • i ran the command "mvn appengine:run" got this exception : Failed to run devappserver: java.nio.file.NoSuchFileException: /home/tiago_sllater/Spring-Boot-GCP/target/Catalog-Service-0.0.1/WEB-INF/appengine-web.xml – Tiago Medici Oct 24 '19 at 10:28
  • I have no idea why this answer is accepted when it is both wrong and missing the point of the question. – kaqqao Jul 05 '23 at 23:07