This project makes it easy for Spring users to run their applications on Google Cloud Platform. You can check our project website here.
For a deep dive into the project, refer to the Spring Cloud GCP Reference documentation below or the latest Javadocs.
If you prefer to learn by doing, try taking a look at the Spring Cloud GCP sample applications or the Spring on GCP codelabs.
Currently, this repository provides support for:
If you have any other ideas, suggestions or bug reports, please use our GitHub issue tracker and let us know!
If you want to collaborate in the project, we would also love to get your Pull Requests. Before you start working on one, please take a look at our collaboration manual.
This project has dependency and transitive dependencies on Spring Projects. The table below outlines the versions of Spring Cloud, Spring Boot and Spring Framework versions that are compatible with certain Spring Cloud GCP version.
Spring Cloud GCP | Spring Cloud | Spring Boot | Spring Framework |
---|---|---|---|
2.0.x |
2020.0.x (3.0/Illford) |
2.4.x, 2.5.x |
5.3.x |
3.x |
2021.0.x (3.1/Jubilee) |
2.6.x |
5.3.x |
Spring Initializr contains Spring Cloud GCP auto-configuration support through the GCP Support
entry.
GCP Messaging
contains the Spring Cloud GCP messaging support with Google Cloud Pub/Sub working out of the box.
Similarly to GCP Messaging
, GCP Storage
contains the Google Cloud Storage support with no other dependencies needed.
If you’re a Maven user, add our BOM to your pom.xml <dependencyManagement>
section.
This will allow you to not specify versions for any of the Maven dependencies and instead delegate versioning to the BOM.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-dependencies</artifactId>
<version>3.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
We offer SNAPSHOT
versions of the project that always reflect the latest code changes to the underlying GitHub repository for Spring Cloud GCP via the Sonatype Snapshots Repository:
<repositories>
<repository>
<id>snapshots-repo</id>
<url>https://google.oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
Spring Boot greatly simplifies the Spring Cloud GCP experience. Our starters handle the object instantiation and configuration logic so you don’t have to.
Every starter depends on the GCP starter to provide critical bits of configuration, like the GCP project ID or OAuth2 credentials location. You can configure these as properties in, for example, a properties file:
spring.cloud.gcp.project-id=[YOUR_GCP_PROJECT_ID]
spring.cloud.gcp.credentials.location=file:[LOCAL_PRIVATE_KEY_FILE]
spring.cloud.gcp.credentials.scopes=[SCOPE_1],[SCOPE_2],[SCOPE_3]
These properties are optional and, if not specified, Spring Boot will attempt to automatically find them for you. For details on how Spring Boot finds these properties, refer to the documentation.
Note
|
If your app is running on Google App Engine or Google Compute Engine, in most cases, you should omit the spring.cloud.gcp.credentials.location property and, instead, let the Spring Cloud GCP Core Starter find the correct credentials for those environments.
|