Stay organized with collections Save and categorize content based on your preferences.
This page describes how to set up your development environment to build and deploy your backend API using Cloud Endpoints Frameworks for the App Engine standard environment. This page uses the Endpoints Frameworks version 2.0 skeleton code sample to explain the basic software and components you need to get started.
You might want to use the endpoints-skeleton-archetype
or the hello-endpoints-archetype
described in Using Apache Maven and the App Engine plugin (Google Cloud CLI-based) to create a new Endpoints Frameworks version 2.0 project.
To get a better understanding of the steps required to deploy a sample API using Endpoints Frameworks, see the tutorial Getting started with Endpoints Frameworks on App Engine.
Before you beginIn the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Verify that billing is enabled for your Google Cloud project.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Verify that billing is enabled for your Google Cloud project.
gcloud auth login
gcloud auth application-default login
app-engine-java
component:
gcloud components install app-engine-java
gcloud components update
gcloud config set project YOUR_PROJECT_ID
Replace YOUR_PROJECT_ID
with your Google Cloud project ID. If you have other Google Cloud projects, and you want to use gcloud
to manage them, see Managing gcloud CLI configurations.
YOUR_PROJECT_ID
with your Google Cloud project ID and YOUR_REGION
with the region that you want the App Engine application created in.
gcloud app create \ --project=YOUR_PROJECT_ID \ --region=YOUR_REGION
The Endpoints Frameworks version 2.0 skeleton sample contains the necessary build scripts for Maven and Gradle. It also contains the required files to get started creating your first API.
Clone the sample repository to your local machine:
git clone https://github.com/GoogleCloudPlatform/java-docs-samples
Change to the directory containing the Endpoints Frameworks skeleton sample:
cd java-docs-samples/appengine-java8/endpoints-v2-skeleton/
The sample has the following directory structure:
MyApi.java
contains an empty class that you can use to get started writing your API. See the echo example for sample code to help you get started.
web.xml
is a standard file that is used to configure a servlet.
appengine-web.xml
defines information that is required to deploy the API to the App Engine standard environment by using Java 8.
pom.xml
contains project and configuration information used by Maven to build the project and deploy the API to App Engine.
build.gradle
contains project and configuration information used by Gradle to build the project and deploy the API to App Engine.
This section describes the Maven pom.xml
and Gradle build.gradle
files included in the sample code. Except for entering your Google Cloud project ID so that it can be used in the hostname, the build files are ready for you to get started creating your API.
This section describes the minimum configuration needed in your build file.
MavenMinimum dependencies
The following shows the minimum dependencies required in your pom.xml
to get started:
endpoints-framework
dependency contains the necessary classes for creating your API.appengine-api-sdk
) to deploy your project to the App Engine standard environment.javax.servlet
package is required to build a servlet.javax.inject
package is required to support dependency injection.Apply plugins
The following plugins are applied to enable them:
maven-war-plugin
extends the java
plugin to add support for assembling a web application.appengine-maven-plugin
is required to run the API on App Engine.endpoints-framework-maven-plugin
provides tasks and configurations to build Endpoints Frameworks projects.Plugin dependencies
The following shows the plugins required to build your API:
Apply plugins
The following plugins are applied to enable them in your Gradle build script:
java
plugin adds Java-specific compilation and build steps to your project.war
plugin extends the java
plugin to add support for assembling a web application.endpoints-framework-server
plugin provides server-side support to the Endpoints Frameworks Gradle plugin.appengine
plugin is required to run the API on App Engine.Project dependencies
The following dependencies are used by the project:
endpoints-framework
dependency contains the necessary classes for creating your API.appengine-api-sdk
) is needed to deploy your project to the App Engine standard environment.javax.servlet
package is required to build a servlet.javax.inject
package is required to support dependency injection.Endpoints Frameworks uses DNS-compatible names to uniquely identify services. Because Google Cloud project IDs are guaranteed to be globally unique, you should use your Google Cloud project ID as part of your API's service name.
You must add your Google Cloud project ID to the build files to configure the hostname for your service. The hostname should be in the following format:
YOUR_PROJECT_ID.appspot.com
When you deploy the API to App Engine, a DNS entry with a name in the format YOUR_PROJECT_ID.appspot.com
is created automatically. The hostname is both the name of the Cloud Endpoints service and the domain name that you use to send requests to your API.
In the hostname
field, replace YOUR_PROJECT_ID
with your Google Cloud project ID.
Set the variable projectID
to your Google Cloud project ID. For example: def projectId = 'example-project-12345'
The Endpoints servlet handles incoming requests and forwards them to the backend service running on App Engine. The Endpoints servlet is required for your API to be managed by Endpoints.
For more information about web.xml
, see The deployment descriptor: web.xml
.
The appengine-web.xml
file is used to define the App Engine standard environment configuration when the API is deployed. See appengine-web.xml
reference for more information.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["This page guides you through setting up a development environment for building and deploying a backend API using Cloud Endpoints Frameworks for the App Engine standard environment."],["You will need to install Java 8, either Maven or Gradle, and the Google Cloud CLI, along with authorizing the gcloud CLI and installing the `app-engine-java` component."],["The Endpoints Frameworks version 2.0 skeleton sample, which includes essential build scripts and files, is obtained by cloning a repository and navigating to the `endpoints-v2-skeleton` directory."],["Configuring the build files (pom.xml for Maven, build.gradle for Gradle) requires adding dependencies like `endpoints-framework` and the `appengine-api-1.0-sdk`, and applying relevant plugins, as well as defining a hostname using your Google Cloud project ID."],["The `web.xml` file needs to be configured with an Endpoints servlet to manage incoming requests and forward them to the backend service, and `appengine-web.xml` should be configured to specify the App Engine standard environment settings."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4