O conteúdo do arquivo gradle.build é um conjunto de regras para descrever sua
versão. Ele é escrito em linguagem específica do domínio para descrever versões com base
na
linguagem Groovy.
Cada tarefa tem propriedades associadas que podem ser usadas. Especifique
essas propriedades no arquivo gradle.build usando uma
tarefa de fechamento de configuração (em inglês)
e propriedades.
Neste exemplo:
O fechamento de configuração do plug-in é appengine.
A tarefa é deploy.
As propriedades, stopPreviousVersion e promote, são definidas como true.
appengine{deploy{// deploy configurationstopPreviousVersion=true// default - stop the current versionpromote=true// default - & make this the current version}}
Se você só tem uma tarefa para especificar algumas propriedades, pode defini-las em uma única linha:
appengine.deploy.stopPreviousVersion=true
Nas seções a seguir, veja uma lista das propriedades disponíveis para cada tarefa.
appengineStage
task(stage)
Gera um diretório do aplicativo para implantação. Usado pelas tarefas
appengineDeploy e jettyRun.
Use as seguintes propriedades:
Propriedade
Descrição
artifact
Artefato criado que contém todas as classes, recursos e manifestos.
O padrão é build/libs/[YOUR_SERVLET].war.
appEngineDirectory
Local do arquivo app.yaml. O padrão é
src/main/appengine.
dockerDirectory
Localização de Dockerfile. O padrão é
src/main/docker.
stagingDirectory
Obrigatório. Diretório onde o aplicativo será testado. O padrão é build/staged-app.
appengineDeploy
task(deploy)
Testa e implanta um aplicativo no App Engine.
Cada tarefa tem propriedades associadas que podem ser usadas. Especifique
essas propriedades no arquivo gradle.build usando uma
tarefa de fechamento de configuração (em inglês)
e propriedades.
No exemplo a seguir:
O fechamento de configuração do plug-in é appengine.
A tarefa é run.
A propriedade, port, está definida como 8080.
appengine{// App Engine tasks configurationrun{// local (dev_appserver) configuration (standard environments only)port=8080// default}deploy{// deploy configurationstopPreviousVersion=true// default - stop the current versionpromote=true// default - & make this the current version}}
Se você só tem uma tarefa para especificar algumas propriedades, pode defini-las em uma única linha:
appengine.run.port=8888
Propriedade
Descrição
appEngineDirectory
Local dos arquivos de configuração .yaml (cron, index etc.) de
onde as implementações específicas de configuração (appengineDeployCron etc.) serão
implantadas. Para aplicativos flexíveis, o padrão é
src/main/appengine.
bucket
bucket do Cloud Storage usado para testar arquivos associados à implantação. Se esse argumento não for especificado, será usado o bucket padrão do aplicativo.
deployables
Arquivos YAML dos serviços ou configurações que você quer implantar.
O padrão é o arquivo app.yaml no diretório de preparo. Se
ele não for encontrado, tentará gerar automaticamente os arquivos de configuração
necessários (como app.yaml) no diretório
de preparo.
imageUrl
Implanta com uma imagem Docker específica. O URL do Docker precisa ser de um dos
nomes de host válidos do Artifact Registry.
project
Nome do projeto do Google Cloud Platform para uso nesta invocação.
O padrão é o projeto atual selecionado no momento da inicialização da ferramenta gcloud. Para verificar,
use gcloud config list project.
promote
Promote the deployed version to receive all traffic. O padrão é True.
server
Servidor do App Engine ao qual conectar-se. Normalmente, você não precisa alterar esse valor.
stopPreviousVersion
Interromper a versão anteriormente em execução ao implantar uma versão nova que recebe todo o tráfego.
version
Versão do app que será criada ou substituída por esta implantação. Se você não especificar uma versão, será gerado um número de versão automaticamente.
Propriedades globais
Propriedade
Descrição
tools.cloudSdkHome
Propriedade opcional para configurar o local da Google Cloud CLI.
Normalmente, o plug-in encontra essa propriedade no CLI gcloud quando é instalado com
gcloud components install app-engine-java.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 UTC."],[[["\u003cp\u003eThe App Engine Gradle plugin provides various tasks for managing and deploying applications, including \u003ccode\u003eappengineStage\u003c/code\u003e, \u003ccode\u003eappengineDeploy\u003c/code\u003e, and others for deploying specific configuration files like \u003ccode\u003ecron.yaml\u003c/code\u003e, \u003ccode\u003edispatch.yaml\u003c/code\u003e, etc.\u003c/p\u003e\n"],["\u003cp\u003eEach task within the App Engine Gradle plugin has configurable properties, which can be set in the \u003ccode\u003egradle.build\u003c/code\u003e file using a configuration closure (e.g., \u003ccode\u003eappengine\u003c/code\u003e) or directly in a single line, like setting \u003ccode\u003eappengine.deploy.stopPreviousVersion = true\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eappengineStage\u003c/code\u003e task generates an application directory for deployment, with configurable properties such as \u003ccode\u003eartifact\u003c/code\u003e, \u003ccode\u003eappEngineDirectory\u003c/code\u003e, \u003ccode\u003edockerDirectory\u003c/code\u003e, and \u003ccode\u003estagingDirectory\u003c/code\u003e, with \u003ccode\u003ebuild/staged-app\u003c/code\u003e being the default for \u003ccode\u003estagingDirectory\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eappengineDeploy\u003c/code\u003e task stages and deploys applications to App Engine, and allows customization of the deployment through various properties, such as \u003ccode\u003epromote\u003c/code\u003e, \u003ccode\u003estopPreviousVersion\u003c/code\u003e, and \u003ccode\u003ebucket\u003c/code\u003e, which dictate the behavior of the deployment.\u003c/p\u003e\n"],["\u003cp\u003eYou can use \u003ccode\u003egradle tasks\u003c/code\u003e to see a complete list of all available tasks within the plugin.\u003c/p\u003e\n"]]],[],null,["# App Engine Gradle Plugin Tasks and Properties\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\nAfter the App Engine Gradle plugin is [added to your project](/appengine/docs/standard/java-gen2/using-gradle#creating_a_new_project),\nyou can use the following App Engine-specific Gradle tasks:\n\nTo see a list of all the tasks: \n\n gradle tasks\n\nFor more information on how to set up and use Gradle, see\n\n[Using\nApp Engine Gradle](/appengine/docs/standard/java-gen2/using-gradle)\nand the\n[`app-gradle-plugin`](https://github.com/GoogleCloudPlatform/app-gradle-plugin)\nrepository on GitHub.\n\nTask properties\n---------------\n\nThe contents of the `gradle.build` file are a set of rules to describe your\nbuild. It's written in a domain specific language for describing builds, based\non the\n[Groovy language](http://www.groovy-lang.org/).\n\nEach task has associated properties below that you can use. You can specify\nthese properties in the `gradle.build` file using a\n[configuration closure](https://docs.gradle.org/current/userguide/custom_plugins.html#sec:getting_input_from_the_build),\ntask, and properties.\n\nIn this example:\n\n- The configuration closure for the plugin is `appengine`.\n- The task is `deploy`.\n- The properties, `stopPreviousVersion` and `promote`, are set to `true`.\n\n appengine {\n deploy { // deploy configuration\n stopPreviousVersion = true // default - stop the current version\n promote = true // default - & make this the current version\n }\n }\n\nIf you only have a to specify a few properties, you can set them in a single line:\n\n\u003cbr /\u003e\n\n```java\n appengine.deploy.stopPreviousVersion = true\n```\n\nSee the following sections for a list of the properties that are available for\neach task.\n\nappengineStage\n--------------\n\n**task(stage)**\n\nGenerates an application directory for deployment. Used by the `appengineDeploy`\ntask and the `jettyRun` task.\n\nYou can use the following properties:\n\nappengineDeploy\n---------------\n\n**task(deploy)**\n\nStages and deploys an application to App Engine.\n\nEach task has associated properties below that you can use. You can specify\nthese properties in the `gradle.build` file using a\n[configuration closure](https://docs.gradle.org/current/userguide/custom_plugins.html#sec:getting_input_from_the_build),\ntask, and properties.\n\nIn the following example:\n\n- The configuration closure for the plugin is `appengine`.\n- The task is `run`.\n- The property, `port`, is set to `8080`.\n\n appengine { // App Engine tasks configuration\n run { // local (dev_appserver) configuration (standard environments only)\n port = 8080 // default\n }\n\n deploy { // deploy configuration\n stopPreviousVersion = true // default - stop the current version\n promote = true // default - & make this the current version\n }\n }\n\nIf you only have a to specify a few properties, you can set them in a single\nline: \n\n```java\n appengine.run.port = 8888\n```\n\nGlobal properties\n-----------------"]]