gradle.build 파일의 콘텐츠는 빌드를 설명하는 규칙 집합입니다. 이 파일은 빌드를 설명하기 위해 Groovy 언어 기반의 도메인 특정 언어로 작성됩니다.
각 태스크에는 아래와 같이 사용 가능한 속성이 연결되어 있습니다. gradle.build 파일에서 구성 닫기, 태스크, 속성을 사용하여 이러한 속성을 지정할 수 있습니다.
다음 샘플은 자바 8용 Gradle 태스크를 지정하는 방법을 보여줍니다.
자바 버전 11 이상을 사용하는 경우 자바 런타임에서 최신 버전 사용에 대한 자세한 내용을 참조하세요.
이 예에서는 다음과 같이 정의됩니다.
플러그인의 구성 닫기는 appengine입니다.
태스크는 deploy입니다.
속성, stopPreviousVersion, promote는 true로 설정됩니다.
appengine{deploy{// deploy configurationstopPreviousVersion=true// default - stop the current versionpromote=true// default - & make this the current version}}
지정할 속성이 많지 않다면 한 줄로 설정할 수 있습니다.
appengine.deploy.stopPreviousVersion=true
각 태스크에 사용할 수 있는 속성 목록은 다음 섹션을 참조하세요.
appengineStage
task(stage)
배포용 애플리케이션 디렉터리를 생성합니다. appengineDeploy 작업 및 jettyRun 작업에서 사용됩니다.
다음 속성을 사용할 수 있습니다.
속성
설명
artifact
클래스, 리소스, 매니페스트가 모두 있는 빌드된 아티팩트입니다.
기본값은 build/libs/[YOUR_SERVLET].war입니다.
각 태스크에는 아래와 같이 사용 가능한 속성이 연결되어 있습니다. gradle.build 파일에서 구성 닫기, 태스크, 속성을 사용하여 이러한 속성을 지정할 수 있습니다.
아래 예시를 참조하세요.
플러그인의 구성 닫기는 appengine입니다.
태스크는 run입니다.
port 속성은 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}}
지정할 속성이 많지 않다면 한 줄로 설정할 수 있습니다.
appengine.run.port=8888
속성
설명
appEngineDirectory
구성별 배포(appengineDeployCron 등)를 수행하는 .yaml 구성 파일(크론, 색인 등)의 위치입니다. 가변형 애플리케이션의 경우 이 기본값은 src/main/appengine입니다.
bucket
배포와 연결된 파일을 스테이징하는 데 사용되는 Cloud Storage 버킷입니다. 이 인수가 지정되지 않으면 애플리케이션의 기본 버킷이 사용됩니다.
deployables
배포하려는 구성 또는 서비스용 YAML 파일.
기본값은 스테이징 디렉터리에 있는 app.yaml 파일입니다. 이 파일을 찾을 수 없는 경우 스테이징 디렉터리에서 필요한 구성 파일(예: app.yaml)의 자동 생성을 시도합니다.
imageUrl
특정 Docker 이미지를 사용하여 배포합니다. Docker URL은 유효한 Artifact Registry 호스트 이름 중 하나여야 합니다.
project
이 호출에 사용할 Google Cloud Platform 프로젝트 이름입니다.
기본값은 gcloud 도구를 초기화할 때 선택한 현재 프로젝트입니다. 확인하려면 gcloud config list project를 사용합니다.
promote
배포된 버전을 승격하여 모든 트래픽을 수신합니다. 기본값은 True입니다.
server
연결할 App Engine 서버입니다. 일반적으로 이 값은 변경할 필요가 없습니다.
stopPreviousVersion
모든 트래픽을 수신하는 새 버전을 배포할 때 이전에 실행 중인 버전을 중지합니다.
version
이 배포에서 생성되거나 대체되는 앱의 버전입니다. 버전을 지정하지 않으면 자동으로 생성됩니다.
전역 속성
속성
설명
tools.cloudSdkHome
Google Cloud CLI의 위치를 구성하는 선택적 속성입니다.
일반적으로 플러그인은 gcloud components install app-engine-java를 통해 설치될 때 gcloud CLI에서 이 속성을 찾습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThe App Engine Gradle plugin provides various tasks for managing Java 8 applications, including \u003ccode\u003eappengineStage\u003c/code\u003e, \u003ccode\u003eappengineDeploy\u003c/code\u003e, and configuration-specific deployment tasks like \u003ccode\u003eappengineDeployCron\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eGradle tasks such as \u003ccode\u003eappengineDeploy\u003c/code\u003e and \u003ccode\u003ejettyRun\u003c/code\u003e utilize the \u003ccode\u003eappengineStage\u003c/code\u003e task to generate the necessary application directory for deployment.\u003c/p\u003e\n"],["\u003cp\u003eYou can configure tasks like \u003ccode\u003edeploy\u003c/code\u003e using properties in the \u003ccode\u003egradle.build\u003c/code\u003e file, allowing you to set parameters like \u003ccode\u003estopPreviousVersion\u003c/code\u003e and \u003ccode\u003epromote\u003c/code\u003e to control the deployment process.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eappengineDeploy\u003c/code\u003e task uses properties such as \u003ccode\u003eappEngineDirectory\u003c/code\u003e, \u003ccode\u003ebucket\u003c/code\u003e, and \u003ccode\u003eimageUrl\u003c/code\u003e to control the specifics of your application's deployment process.\u003c/p\u003e\n"],["\u003cp\u003eTo see all the tasks available you can use the command: \u003ccode\u003egradle tasks\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# App Engine Gradle Plugin Tasks and Properties\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nAfter the App Engine Gradle plugin is [added to your project](/appengine/docs/flexible/java/using-gradle#creating_a_new_project), you can use the following App Engine-specific Gradle tasks in your Java 8 app:\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/flexible/java/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.\nThe following sample demonstrates how to specify Gradle tasks for Java 8. For Java version 11 and later, see [Java runtime](/appengine/docs/flexible/java/runtime) for more information about using newer versions.\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-----------------"]]