You can deploy your API using the App Engine
Apache Maven
or Gradle plugins. To deploy your
API to a production App Engine standard environment, use the command for
your plugin:
Use the command for your plugin:
Maven
mvnappengine:deploy
Gradle
gradleappengineDeploy
Wait for the deployment to finish.
Send a test request to your deployed API. For example, using curl:
To serve your API from a different path, in your web.xml file, change the
url-pattern in the EndpointsServlet section and redeploy your API. For
example:
For your API to be managed by Endpoints Frameworks, you must generate
and deploy an OpenAPI document that describes your API, as described in
Adding API management.
[[["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-09-04 UTC."],[[["\u003cp\u003eThis guide details the process of deploying an API using either the App Engine Apache Maven or Gradle plugins, providing the necessary commands for each.\u003c/p\u003e\n"],["\u003cp\u003eYou can test your deployed API by sending a request using \u003ccode\u003ecurl\u003c/code\u003e, as illustrated with an example that includes the expected response format.\u003c/p\u003e\n"],["\u003cp\u003eThe document explains how to deploy to multiple API versions and how to handle API versioning.\u003c/p\u003e\n"],["\u003cp\u003eIt outlines the steps to run and test your API backends locally, involving project build and starting the App Engine development server.\u003c/p\u003e\n"],["\u003cp\u003eEndpoints Frameworks offers API management features such as monitoring, logging, quotas, and a developer portal, requiring the deployment of an OpenAPI document for full functionality.\u003c/p\u003e\n"]]],[],null,["# Deploying and testing an API\n\nThis page describes how to deploy your API.\n\nBefore you begin\n----------------\n\n- [Set up your programming environment](/endpoints/docs/frameworks/java/set-up-environment).\n- [Create an API](/endpoints/docs/frameworks/java/annotate-code) and annotate it.\n\nDeploying an API\n----------------\n\nYou can deploy your API using the App Engine\n[Apache Maven](/appengine/docs/standard/java/using-maven)\nor [Gradle](/appengine/docs/standard/java/using-gradle) plugins. To deploy your\nAPI to a production App Engine standard environment, use the command for\nyour plugin:\n\n1. Use the command for your plugin: \n\n ### Maven\n\n ```bash\n mvn appengine:deploy\n ```\n\n ### Gradle\n\n ```bash\n gradle appengineDeploy\n ```\n2. Wait for the deployment to finish.\n3. Send a test request to your deployed API. For example, using `curl`:\n\n curl \\\n -H \"Content-Type: application/json\" \\\n -X POST \\\n -d '{\"message\": \"echo\"}' \\\n \"https://YOUR-PROJECT-ID.appspot.com/_ah/api/echo/v1/echo?n=2\"\n\n Your response is similar to the following: \n\n ```\n {\n \"message\": \"echo echo\"\n }\n ```\n\nIf you didn't get a successful response, see\n[Troubleshooting response errors](/endpoints/docs/frameworks/troubleshoot-response-errors).\n\nDeploying to multiple application versions\n------------------------------------------\n\nFor information on how to do API versioning, and how to deploy to versions,\nsee [Handling API versioning](/endpoints/docs/frameworks/java/handling-api-versioning)\n\nRunning and testing API backends locally\n----------------------------------------\n\nTo test your API locally:\n\n1. Build the project in the root directory of the project. For example:\n\n ### Maven\n\n ```bash\n mvn clean package\n ```\n\n ### Gradle\n\n ```bash\n gradle clean build\n ```\n2. Start the App Engine development server. For example:\n\n ### Maven\n\n ```bash\n mvn appengine:run\n ```\n\n ### Gradle\n\n ```bash\n gradle appengineRun\n ```\n3. Make an API request to test your API. For example, using `curl`:\n\n curl \\\n -H \"Content-Type: application/json\" \\\n -X POST \\\n -d '{\"message\": \"echo\"}' \\\n \"${HOST}/_ah/api/echo/v1/echo?n=2\"\n\nServing your API from a different path\n--------------------------------------\n\nTo serve your API from a different path, in your `web.xml` file, change the\n`url-pattern` in the `EndpointsServlet` section and redeploy your API. For\nexample: \n\n \u003cservlet-mapping\u003e\n \u003cservlet-name\u003eEndpointsServlet\u003c/servlet-name\u003e\n \u003curl-pattern\u003e/example-api/*\u003c/url-pattern\u003e\n \u003c/servlet-mapping\u003e\n\nAdding API management\n---------------------\n\nEndpoints Frameworks provides API management features such as:\n\n- [Monitoring](/endpoints/docs/frameworks/monitoring-your-api)\n- [Logging](/endpoints/docs/frameworks/monitoring-your-api#logs)\n- [Quotas](/endpoints/docs/openapi/quotas-overview)\n- [Developer portal](/endpoints/docs/openapi/dev-portal-overview)\n\nFor your API to be managed by Endpoints Frameworks, you must generate\nand deploy an OpenAPI document that describes your API, as described in\n[Adding API management](/endpoints/docs/frameworks/java/adding-api-management)."]]