Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions run/helloworld/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# [START cloudrun_helloworld_dockerfile]
# Use the official maven image to create a build artifact.
# https://hub.docker.com/_/maven
FROM maven:3-eclipse-temurin-17-alpine as builder
FROM maven:3-eclipse-temurin-25-alpine as builder
Comment thread
Kef131 marked this conversation as resolved.

# Copy local code to the container image.
WORKDIR /app
Expand All @@ -27,7 +27,7 @@ RUN mvn package -DskipTests

# Use Eclipse Temurin for base image.
# https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds
FROM eclipse-temurin:17.0.18_8-jre-alpine
FROM eclipse-temurin:25-jre-alpine
Comment thread
Kef131 marked this conversation as resolved.

# Copy the jar to the production image from the builder stage.
COPY --from=builder /app/target/helloworld-*.jar /helloworld.jar
Expand Down
19 changes: 14 additions & 5 deletions run/helloworld/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ limitations under the License.
<parent>
<groupId>com.google.cloud.samples</groupId>
<artifactId>shared-configuration</artifactId>
<version>1.2.0</version>
<version>1.2.2</version>
</parent>
<dependencyManagement>
<dependencies>
Expand All @@ -41,9 +41,10 @@ limitations under the License.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<spring-boot.version>3.2.2</spring-boot.version>
<!--Change this to 25 in your workspace-->
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<spring-boot.version>3.5.0</spring-boot.version>
</properties>
<dependencies>
<dependency>
Expand All @@ -68,6 +69,11 @@ limitations under the License.
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.14</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
Expand All @@ -84,8 +90,11 @@ limitations under the License.
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.4.0</version>
<version>3.4.6</version>
<configuration>
<from>
<image>eclipse-temurin:25-jre-alpine</image>
</from>
Comment thread
Kef131 marked this conversation as resolved.
<to>
<image>gcr.io/PROJECT_ID/helloworld</image>
</to>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.springframework.test.web.servlet.MockMvc;

@RunWith(SpringRunner.class)
@SpringBootTest
@SpringBootTest(classes = HelloworldApplication.class)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think with the new update it is safe to remove the @RunWith annotation which looks obsolete in JUnit5 and also change it like

Suggested change
@SpringBootTest(classes = HelloworldApplication.class)
@SpringBootTest

Following this docs: https://docs.spring.io/spring-boot/3.5/reference/testing/spring-boot-applications.html

@AutoConfigureMockMvc
public class HelloworldApplicationTests {

Expand Down