我下载了示例Java项目:
https://github.com/GoogleCloudPlatform/appengine-try-java
我能够在AppEngine标准环境中部署它,但是我无法传递我在其中定义一些环境变量的自定义app.yaml
配置文件。为此,我在app.yaml
中创建了/src/main/appengine/
。
是否可以直接在pom.xml
文件中进行配置?
我试图跑步:
mvn clean appengine:deploy -Dapp.deploy.appEngineDirectory=src/main/appengine/
但这没什么区别,我看到的时候是
[INFO] GCLOUD: Services to deploy:
[INFO] GCLOUD:
[INFO] GCLOUD: descriptor: [/target/appengine-staging/app.yaml]
当我打开此app.yaml
时,我的配置文件不包含在内,并且被忽略。
答案 0 :(得分:3)
默认情况下,Java标准环境使用appengine-web.xml
文件,而不使用app.yaml
文件。是的,可以在其中设置环境变量。来自appengine-web.xml Reference:
可选。 appengine-web.xml文件可以定义环境变量 在应用程序运行时设置的值。
<env-variables> <env-var name="DEFAULT_ENCODING" value="UTF-8" /> </env-variables>
您下载的应用程序的文件位于src / main / webapp / WEB-INF / appengine-web.xml