<br />

<br />


An App Engine app is configured using an `app.yaml`
file, that contains the runtime, handlers, scaling, and other general settings
including environment variables.


## About `app.yaml` files

<br />

You can specify the runtime configuration for your Java app, including versions and URLs, in the `app.yaml` file. This file acts as a deployment descriptor of a specific [service](https://docs.cloud.google.com/appengine/docs/standard/an-overview-of-app-engine) version.

<br />


If you don't create an `app.yaml` file, the `gcloud app deploy` command can
[create one when you deploy your
application](https://docs.cloud.google.com/appengine/docs/standard/testing-and-deploying-your-app#other_deployment_options).
The `app.yaml` file that App Engine creates contains only the settings
that are required to run your application.


Generally, your `app.yaml` file requires only the `runtime` element for a simple
Java app in the standard environment, for
example:


    runtime: java25


App Engine provides default values for all other settings, including
the [F1 instance class](https://docs.cloud.google.com/appengine/docs/standard#instance_classes), which
determines the memory and CPU resources that are available to your app, and
[automatic scaling](https://docs.cloud.google.com/appengine/docs/standard/how-instances-are-managed#scaling_types),
which controls how and when new instances of your app are created.

If you need to override the default settings, create an `app.yaml` file and
specify the settings you need. For more information, see
[`app.yaml` file reference](https://docs.cloud.google.com/appengine/docs/standard/reference/app-yaml).


You can specify a unique name for your `app.yaml` files, but then you must
specify the file name with the [deployment
command](https://docs.cloud.google.com/appengine/docs/standard/testing-and-deploying-your-app)
as well. For example, if you name your `app.yaml` file `service-name-app.yaml`
or `app.standard.yaml`, then you must deploy your app using either:

    gcloud app deploy service-name-app.yaml
    gcloud app deploy app.standard.yaml

To learn more about structuring multiple services and `app.yaml` files in your app, see [Structuring web services](https://docs.cloud.google.com/appengine/docs/standard/configuration-files).

For a Maven project, the standard location for `app.yaml` file is under the
`src/main/appengine` directory. The App Engine Maven plugin will
create a correct `target/appengine-staging` directory containing your JAR
artifacts and this `app.yaml` file, ready for deployment.

The following is a sample Maven project structure:

    MyDir/
      pom.xml
      [index.yaml]
      [cron.yaml]
      [dispatch.yaml]
      src/main/
        appengine/
          app.yaml
        java/com.example.mycode/
          MyCode.java

If you have more than one JAR file in your project directory or want to
specify a custom entrypoint, you must specify it in the `entrypoint` element of
your `app.yaml` file.

## All configuration elements

For a complete list of all the supported elements in this configuration file,
see the
[`app.yaml` reference](https://docs.cloud.google.com/appengine/docs/standard/reference/app-yaml).