-
Notifications
You must be signed in to change notification settings - Fork 64
specifying dependencies
You can use any Java compatible libraries with the Java runtime on the App Engine standard environment.
These instructions use Apache Maven to build, run, and deploy a sample app.
For details about installing Maven, see Using Apache Maven and the App Engine plugin.
To manage dependencies using Maven, you need to specify the dependencies in the
<dependencies> section inside the
pom.xml
file of your project.
To manage your project's dependency on Maven itself, you can use the Maven
Wrapper. If you do not use the Maven
Wrapper, App Engine defaults to using a recent version of Maven when running
gcloud app deploy.
If you need to host private dependencies for your Java app, you can use an {{ar_name_short}} Maven repository. Connecting to a Maven repository hosted on Artifact Registry requires the {{ar_name_short}} Maven Tools plugin for your Maven or Gradle configuration.
Eclipse Jetty and Tomcat apps require the Java servlet library. Specify it in
your pom.xml file's <dependencies> entry:
Note that frameworks such as SparkJava or Spring Boot won't require the servlet library.
{{java_client_lib_name}} provide idiomatic access to Google Cloud services. To use a library, declare it as a dependency.
Typically, you only declare dependencies on the specific libraries that your app needs. For example, to use the Cloud Storage library:
You can configure the {{java_client_lib_name}} to handle authentication automatically.