Multivalued parameter for mvn appengine:deploy

风流意气都作罢 提交于 2019-12-24 05:53:43

问题


I'm trying to execute a Maven goal which takes a parameter with multiple values (list of values). How can I do that?

In gcloud this can be done with gcloud app deploy --quiet --project $(PROJECT) -v $(VERSION) app.yaml backend.yaml cron.yaml index.yaml queue.yaml

But we are using Maven.

We tried

mvn appengine:deploy -Dapp.deploy.deployables=app.yaml cron.yml queue.yaml

But this is not working. In fact, five commands are needed just to deploy.

mvn appengine:deploy 
mvn appengine:deployCron
mvn appengine:deployDispatch
mvn appengine:deployIndex 
mvn appengine:deployQueue 

How can this be done in one command in Maven?


回答1:


The values for -Dapp.deploy.deployables should be comma-separated. However, app.yaml needs to point to a staged location when using this flag, so you may need to stage your app beforehand with mvn appengine:stage if you want to deploy it with other configuration files.

$ mvn appengine:stage
$ mvn appengine:deploy -Dapp.deploy.deployables=src/main/appengine/queue.yaml,target/appengine-staging/app.yaml

In the output of the last command, you'll see something like

INFO: submitting command: <...>/bin/gcloud app deploy <...>/src/main/appengine/queue.yaml <...>/target/appengine-staging/app.yaml
[INFO] GCLOUD: Services to deploy:
[INFO] GCLOUD: 
[INFO] GCLOUD: descriptor:      [<...>/target/appengine-staging/app.yaml]
[INFO] GCLOUD: source:          [<...>/target/appengine-staging]
[INFO] GCLOUD: target project:  [<...>]
[INFO] GCLOUD: target service:  [default]
[INFO] GCLOUD: target version:  [20170807t115019]
[INFO] GCLOUD: target url:      [https://<...>]
[INFO] GCLOUD: 
[INFO] GCLOUD: 
[INFO] GCLOUD: Configurations to update:
[INFO] GCLOUD: 
[INFO] GCLOUD: descriptor:      [<...>/src/main/appengine/queue.yaml]
[INFO] GCLOUD: type:            [task queues]
[INFO] GCLOUD: target project:  [<...>]
[INFO] GCLOUD: 
[INFO] GCLOUD: 
[INFO] GCLOUD: If this is your first deployment, this may take a while...
[INFO] GCLOUD: ....done.
[INFO] GCLOUD: 
[INFO] GCLOUD: Beginning deployment of service [default]...
[INFO] GCLOUD: Building and pushing image for service [default]


来源:https://stackoverflow.com/questions/44675882/multivalued-parameter-for-mvn-appenginedeploy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!