[[["容易理解","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-08-19 (世界標準時間)。"],[[["\u003cp\u003eThis guide details how to set up a development environment for deploying Java 8 applications to the App Engine standard environment using Maven.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves installing the Java SE 8 SDK, the gcloud CLI, and the App Engine Java component, as well as configuring Maven.\u003c/p\u003e\n"],["\u003cp\u003eCreating a new App Engine project is achieved through Maven archetypes, where you'll set the application ID, choose the correct archetype, and define properties like group ID and project name.\u003c/p\u003e\n"],["\u003cp\u003eYou must also add the gcloud CLI-based plugin to the project's \u003ccode\u003epom.xml\u003c/code\u003e file and then configure it with your Google Cloud Platform project ID.\u003c/p\u003e\n"],["\u003cp\u003eCloud Build needs to be granted permission to deploy apps in order to successfully build and deploy Java 8 apps to App Engine.\u003c/p\u003e\n"]]],[],null,["# Getting Started: Setting Up Your Development Environment\n\nLearn how to set up your build environment for app development and deployment\nto the Java 8 runtime in the App Engine standard environment.\n\nThis guide will show you how to:\n\n- Install the [Google Cloud CLI](/sdk/docs/install).\n- Install and configure the App Engine plugin for Maven. App Engine also provides plugins for [Gradle](/appengine/docs/legacy/standard/java/using-gradle), [IntelliJ IDEA](/code/docs/intellij/create-standard), and [Eclipse](/eclipse/docs), but this guide demonstrates the Maven plugin.\n- Create a new App Engine project.\n- Give permission to Cloud Build to enable building and deploying your app.\n\nInstalling required SDKs\n------------------------\n\n1. If you haven't already installed Java SE 8 SDK,\n [install the Java SE 8 Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index.html).\n\n2. Install and initialize the latest version of the gcloud CLI.\n\n [Install and Initialize gcloud CLI](/sdk/docs)\n3. Install the App Engine Java component:\n\n gcloud components install app-engine-java\n\n4. Authorize your user account:\n\n gcloud auth application-default login\n\nConfiguring Maven in your development environment\n-------------------------------------------------\n\n1. [Download](http://maven.apache.org/download.cgi)\n Maven 3.5 or later from the Maven website.\n\n2. [Install](http://maven.apache.org/install.html)\n Maven 3.5 or later on your local machine.\n\n | **Note:** Linux users may need to download Maven instead of using `apt-get install` to install Maven.\n\nCreating a new App Engine project\n---------------------------------\n\nTo create an App Engine App:\n\n1. Create a new directory.\n\n2. Initialize the new project in the created directory:\n\n mvn archetype:generate -Dappengine-version=1.9.59 -Djava8=true -DCloudSDK_Tooling=true -Dapplication-id=your-app-id -Dfilter=com.google.appengine.archetypes:\n\n 1. Set `-Dappengine-version` to the most recent version of the App\n Engine SDK for Java, and `application-id` to the ID of your\n Google Cloud project.\n\n 2. Set `-Djava8=true` to deploy the project in the Java 8 runtime.\n\n 3. Set `-DCloudSDK_Tooling=true` to use gcloud CLI tooling.\n\n3. When prompted to choose an archetype, choose the value `2` for the\n App Engine skeleton archetype. This creates an empty project that contains\n the required directory structure and files.\n\n4. When prompted for version, press \u003ckbd\u003eENTER\u003c/kbd\u003e to select the default\n most recent version.\n\n5. When prompted to `Define value for property 'groupId'`, supply the desired namespace\n for your app; for example, `com.mycompany.myapp`.\n\n6. When prompted to `Define value for property 'artifactId'`, supply the project\n name; for example, `myapp`.\n\n7. When prompted to `Define value for property 'version'`, accept the default\n value.\n\n8. When prompted to `Define value for property 'package'`, supply your\n preferred package name (or accept the default). The generated Java files will\n have the package name you specify here.\n\n9. When prompted to confirm your choices, accept the default value (`Y`).\n\n10. Wait for the project to finish generating, then change directories to the\n new project directory, for example `myapp/`.\n\n11. Add the gcloud CLI-based plugin to your project's `pom.xml` file.\n\n \u003cbuild\u003e\n \u003cplugins\u003e\n [...]\n \u003cplugin\u003e\n \u003cgroupId\u003ecom.google.cloud.tools\u003c/groupId\u003e\n \u003cartifactId\u003eappengine-maven-plugin\u003c/artifactId\u003e\n \u003cversion\u003e2.4.4\u003c/version\u003e\n \u003cconfiguration\u003e\n \u003cprojectId\u003eyour-project-ID-goes-here\u003c/projectId\u003e\n \u003cversion\u003e1\u003c/version\u003e\n \u003c/configuration\u003e\n \u003c/plugin\u003e\n [...]\n \u003c/plugins\u003e\n \u003c/build\u003e\n\n12. Specify the target Google Cloud Platform project ID and the [service and\n version](/appengine/docs/legacy/standard/java/an-overview-of-app-engine#versions_and_instances)\n in the plugin configuration.\n\nGive permission to Cloud Build\n------------------------------\n\nWhen you deploy your app, App Engine uses Cloud Build to build the\napp into a container and deploy the container to the runtime. Cloud Build\ndoes not have permission to deploy Java 8 apps by default, so you need to\n[give Cloud Build permission to\ndeploy apps](/build/docs/securing-builds/set-service-account-permissions#granting_additional_access)\nin your project. The builds are created in the app's region.\n\nWhat's next\n-----------\n\nNow that your development environment is set up, you can get started\ndeveloping and deploying Java apps to App Engine.\n\n- [Serving Static Content](/appengine/docs/legacy/standard/java/building-app/static-content)\n- [Handling Form Data](/appengine/docs/legacy/standard/java/building-app/handling-form-data)\n- [Using Cloud SQL](/appengine/docs/legacy/standard/java/building-app/cloud-sql)\n- [Executing Code Asynchronously](/appengine/docs/legacy/standard/java/building-app/taskqueues)"]]