# google-cloud-run overview (0.93.0)

0.93.0 (latest) 0.91.0 0.88.0 0.87.0 0.85.0 0.83.0 0.82.0 0.80.0 0.78.0 0.76.0 0.75.0 0.74.0 0.73.0 0.72.0 0.70.0 0.68.0 0.67.0 0.64.0 0.63.0 0.62.0 0.60.0 0.59.0 0.58.0 0.57.0 0.56.0 0.55.0 0.54.0 0.53.0 0.52.0 0.51.0 0.49.0 0.48.0 0.47.0 0.46.0 0.45.0 0.44.0 0.43.0 0.42.0 0.41.0 0.40.0 0.39.0 0.37.0 0.36.0 0.35.0 0.34.0 0.33.0 0.32.0 0.31.0 0.30.0 0.29.0 0.28.0 0.27.0 0.24.0 0.23.0 0.22.0 0.21.0 0.20.0 0.19.0 0.18.0 0.17.0 0.16.0 0.15.0 0.14.0 0.13.0 0.12.0 0.11.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.0 0.3.5 0.2.1 0.1.2

## Key Reference Links

**Cloud Run Description:** Is a managed compute platform that enables you to run containers that are invocable via requests or events.

|---|---|---|
| [Cloud Run Product Reference](https://cloud.google.com/run/docs) | [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-run) | [Maven artifact](https://central.sonatype.com/artifact/com.google.cloud/google-cloud-run) |

## Getting Started

In order to use this library, you first need to go through the following steps:

- [Install a JDK (Java Development Kit)](https://cloud.google.com/java/docs/setup#install_a_jdk_java_development_kit)
- [Select or create a Cloud Platform project](https://console.cloud.google.com/project)
- [Enable billing for your project](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
- [Enable the API](https://console.cloud.google.com/apis/library/run.googleapis.com)
- [Set up authentication](https://cloud.google.com/docs/authentication/client-libraries)

## Use the Cloud Run for Java

To ensure that your project uses compatible versions of the libraries
and their component artifacts, import `com.google.cloud:libraries-bom` and use
the BOM to specify dependency versions. Be sure to remove any versions that you
set previously. For more information about
BOMs, see [Google Cloud Platform Libraries BOM](https://cloud.google.com/java/docs/bom).

### Maven

Import the BOM in the `dependencyManagement` section of your `pom.xml` file.
Include specific artifacts you depend on in the `dependencies` section, but don't
specify the artifacts' versions in the `dependencies` section.

The example below demonstrates how you would import the BOM and include the `google-cloud-run` artifact.

```xml
<dependencyManagement>
 <dependencies>
   <dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>libraries-bom</artifactId>
      <version>26.85.0-SNAPSHOT</version>
      <type>pom</type>
      <scope>import</scope>
   </dependency>
 </dependencies>
</dependencyManagement>

<dependencies>
 <dependency>
   <groupId>com.google.cloud</groupId>
   <artifactId>google-cloud-run</artifactId>
 </dependency>
</dependencies>
```

### Gradle

BOMs are supported by default in Gradle 5.x or later. Add a `platform`
dependency on `com.google.cloud:libraries-bom` and remove the version from the
dependency declarations in the artifact's `build.gradle` file.

The example below demonstrates how you would import the BOM and include the `google-cloud-run` artifact.

```groovy
implementation(platform("com.google.cloud:libraries-bom:26.85.0-SNAPSHOT"))
implementation("com.google.cloud:google-cloud-run")
```

The `platform` and `enforcedPlatform` keywords supply dependency versions
declared in a BOM. The `enforcedPlatform` keyword enforces the dependency
versions declared in the BOM and thus overrides what you specified.

For more details of the `platform` and `enforcedPlatform` keywords Gradle 5.x or higher, see
[Gradle: Importing Maven BOMs](https://docs.gradle.org/current/userguide/platforms.html#sub:bom_import).

If you're using Gradle 4.6 or later, add
`enableFeaturePreview('IMPROVED_POM_SUPPORT')` to your `settings.gradle` file. For details, see
[Gradle 4.6 Release Notes: BOM import](https://docs.gradle.org/4.6/release-notes.html#bom-import).
Versions of Gradle earlier than 4.6 don't support BOMs.


### SBT

SBT [doesn't support BOMs](https://github.com/sbt/sbt/issues/4531). You can find
recommended versions of libraries from a particular BOM version on the
[dashboard](https://storage.googleapis.com/cloud-opensource-java-dashboard/com.google.cloud/libraries-bom/index.html)
and set the versions manually.
To use the latest version of this library, add this to your dependencies:

```scala
libraryDependencies += "com.google.cloud" % "google-cloud-run" % "0.93.0"
```

## Which version ID should I get started with?

For this library, we recommend using [com.google.cloud.run.v2](https://cloud.google.com/java/docs/reference/google-cloud-run/0.93.0/com.google.cloud.run.v2) for new applications.

### Understanding Version ID and Library Versions

When using a Cloud client library, it's important to distinguish between two types of versions:

- **Library Version**: The version of the software package (the client library) that helps you interact with the Cloud service. These libraries are released and updated frequently with bug fixes, improvements, and support for new service features and versions. The version selector at the top of this page represents the client library version.
- **Version ID**: The version of the Cloud service itself (e.g. Cloud Run). New Version IDs are introduced infrequently, and often involve changes to the core functionality and structure of the Cloud service itself. The packages in the lefthand navigation represent packages tied to a specific Version ID of the Cloud service.

### Managing Library Versions

We recommend using the `com.google.cloud:libraries-bom` installation method detailed above to streamline dependency management
across multiple Cloud Java client libraries. This ensures compatibility and simplifies updates.

### Choosing the Right Version ID

Each Cloud Java client library may contain packages tied to specific Version IDs (e.g., `v1`, `v2alpha`). For new production applications, use
the latest stable Version ID. This is identified by the highest version number **without** a suffix (like "alpha" or "beta"). You can read more about
[Cloud API versioning strategy here](https://cloud.google.com/apis/design/versioning).

**Important** : Unstable Version ID releases (those *with* suffixes) are subject to breaking changes when upgrading. Use them only for testing or if you specifically need their experimental features.