Skip to content

Commit bc2ed9e

Browse files
authored
deps: bump Spring Boot to 3.1.3 for Cloud Run sample (#1023)
Update the Cloud Run sample to use the latest version of Spring Boot. This also requires Java 17 or higher.
1 parent 0215ea3 commit bc2ed9e

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

samples/java/cloud-run/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
# Use the official maven/Java image to create a build artifact.
16-
FROM maven:3.8-jdk-11 as builder
16+
FROM maven:3.9.4-eclipse-temurin-17 as builder
1717

1818
# Copy local code to the container image.
1919
WORKDIR /app
@@ -24,7 +24,7 @@ COPY src ./src
2424
RUN mvn package -DskipTests
2525

2626
# Use AdoptOpenJDK for base image.
27-
FROM adoptopenjdk/openjdk11:alpine-jre
27+
FROM eclipse-temurin:17-jre-alpine
2828

2929
# Copy the jar to the production image from the builder stage.
3030
COPY --from=builder /app/target/google-cloud-spanner-pgadapter-samples-cloud-run-*.jar /google-cloud-spanner-pgadapter-samples-cloud-run.jar

samples/java/cloud-run/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# PGAdapter Cloud Run Sample for Java
22

3-
This sample application shows how to build and deploy a Java application with PGAdapter to Google Cloud Run.
3+
This sample application shows how to build and deploy a Java application with PGAdapter to Google
4+
Cloud Run. This sample runs PGAdapter as an in-process dependency with the Java application. You
5+
can also [run PGAdapter as a side-car container](../../cloud-run/java).
46

57
The sample is based on the [Cloud Run Quickstart Guide for Java](https://cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-java-service).
68
Refer to that guide for more in-depth information on how to work with Cloud Run.

samples/java/cloud-run/pom.xml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,9 @@
1515
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1616
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1717
<properties>
18-
<java.version>1.8</java.version>
19-
<maven.compiler.source>1.8</maven.compiler.source>
20-
<maven.compiler.target>1.8</maven.compiler.target>
21-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
22-
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
23-
24-
<spring-boot.version>2.7.11</spring-boot.version>
18+
<maven.compiler.source>17</maven.compiler.source>
19+
<maven.compiler.target>17</maven.compiler.target>
20+
<java.version>17</java.version>
2521
<junixsocket.version>2.7.0</junixsocket.version>
2622
</properties>
2723

@@ -40,7 +36,7 @@
4036
<dependency>
4137
<groupId>org.springframework.boot</groupId>
4238
<artifactId>spring-boot-dependencies</artifactId>
43-
<version>${spring-boot.version}</version>
39+
<version>3.1.3</version>
4440
<type>pom</type>
4541
<scope>import</scope>
4642
</dependency>
@@ -89,7 +85,6 @@
8985
<plugin>
9086
<groupId>org.springframework.boot</groupId>
9187
<artifactId>spring-boot-maven-plugin</artifactId>
92-
<version>${spring-boot.version}</version>
9388
<executions>
9489
<execution>
9590
<goals>
@@ -109,9 +104,9 @@
109104
</configuration>
110105
</plugin>
111106
<plugin>
112-
<groupId>com.coveo</groupId>
107+
<groupId>com.spotify.fmt</groupId>
113108
<artifactId>fmt-maven-plugin</artifactId>
114-
<version>2.13</version>
109+
<version>2.20</version>
115110
<executions>
116111
<execution>
117112
<goals>

samples/java/cloud-run/src/main/java/com/google/cloud/spanner/pgadapter/sample/PGAdapter.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ public String getConnectionUrl() {
5656
* @param instance the Cloud Spanner instance that PGAdapter should connect to
5757
*/
5858
static ProxyServer startPGAdapter(String project, String instance) {
59-
OptionsMetadata options = OptionsMetadata.newBuilder()
60-
.setProject(project)
61-
.setInstance(instance)
62-
.build();
59+
OptionsMetadata options =
60+
OptionsMetadata.newBuilder()
61+
.setProject(project)
62+
.setInstance(instance)
63+
.build();
6364
ProxyServer server = new ProxyServer(options);
6465
server.startServer();
6566
server.awaitRunning();

0 commit comments

Comments
 (0)