Skip to content

Commit 29f170f

Browse files
committed
Fixing Helloworld to Java21 for stability
1 parent c038f39 commit 29f170f

File tree

2 files changed

+119
-81
lines changed

2 files changed

+119
-81
lines changed

run/helloworld-source/pom.xml

Lines changed: 97 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -12,86 +12,105 @@ See the License for the specific language governing permissions and
1212
limitations under the License.
1313
-->
1414
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
15-
<modelVersion>4.0.0</modelVersion>
16-
<groupId>com.example.run</groupId>
17-
<artifactId>helloworld-source</artifactId>
18-
<version>0.0.1-SNAPSHOT</version>
19-
<packaging>jar</packaging>
15+
<modelVersion>4.0.0</modelVersion>
16+
<groupId>com.example.run</groupId>
17+
<artifactId>helloworld</artifactId>
18+
<version>0.0.1-SNAPSHOT</version>
19+
<packaging>jar</packaging>
2020

21-
<!-- The parent pom defines common style checks and testing strategies for our samples.
22-
Removing or replacing it should not affect the execution of the samples in anyway. -->
21+
<!-- The parent pom defines common style checks and testing strategies for our samples.
22+
Removing or replacing it should not affect the execution of the samples in anyway. -->
2323

24-
<parent>
25-
<groupId>com.google.cloud.samples</groupId>
26-
<artifactId>shared-configuration</artifactId>
27-
<version>1.2.0</version>
28-
</parent>
29-
<dependencyManagement>
24+
<parent>
25+
<groupId>com.google.cloud.samples</groupId>
26+
<artifactId>shared-configuration</artifactId>
27+
<version>1.2.0</version>
28+
</parent>
29+
<dependencyManagement>
30+
<dependencies>
31+
<dependency>
32+
<!-- Import dependency management from Spring Boot -->
33+
<groupId>org.springframework.boot</groupId>
34+
<artifactId>spring-boot-dependencies</artifactId>
35+
<version>${spring-boot.version}</version>
36+
<type>pom</type>
37+
<scope>import</scope>
38+
</dependency>
39+
</dependencies>
40+
</dependencyManagement>
41+
<properties>
42+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
43+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
44+
<maven.compiler.source>21</maven.compiler.source>
45+
<maven.compiler.release>21</maven.compiler.release>
46+
<spring-boot.version>3.2.2</spring-boot.version>
47+
</properties>
3048
<dependencies>
31-
<dependency>
32-
<!-- Import dependency management from Spring Boot -->
33-
<groupId>org.springframework.boot</groupId>
34-
<artifactId>spring-boot-dependencies</artifactId>
35-
<version>${spring-boot.version}</version>
36-
<type>pom</type>
37-
<scope>import</scope>
38-
</dependency>
49+
<dependency>
50+
<groupId>org.springframework.boot</groupId>
51+
<artifactId>spring-boot-starter-web</artifactId>
52+
</dependency>
53+
<dependency>
54+
<groupId>org.springframework.boot</groupId>
55+
<artifactId>spring-boot-starter-test</artifactId>
56+
<scope>test</scope>
57+
</dependency>
58+
<dependency>
59+
<groupId>org.junit.vintage</groupId>
60+
<artifactId>junit-vintage-engine</artifactId>
61+
<scope>test</scope>
62+
</dependency>
63+
<dependency>
64+
<groupId>junit</groupId>
65+
<artifactId>junit</artifactId>
66+
<scope>test</scope>
67+
</dependency>
3968
</dependencies>
40-
</dependencyManagement>
41-
<properties>
42-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
43-
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
44-
<maven.compiler.target>25</maven.compiler.target>
45-
<maven.compiler.source>25</maven.compiler.source>
46-
<spring-boot.version>3.5.6</spring-boot.version>
47-
</properties>
48-
<dependencies>
49-
<dependency>
50-
<groupId>org.springframework.boot</groupId>
51-
<artifactId>spring-boot-starter-web</artifactId>
52-
</dependency>
53-
<dependency>
54-
<groupId>org.springframework.boot</groupId>
55-
<artifactId>spring-boot-starter-test</artifactId>
56-
<scope>test</scope>
57-
</dependency>
58-
<dependency>
59-
<groupId>org.junit.vintage</groupId>
60-
<artifactId>junit-vintage-engine</artifactId>
61-
<scope>test</scope>
62-
</dependency>
63-
<dependency>
64-
<groupId>junit</groupId>
65-
<artifactId>junit</artifactId>
66-
<scope>test</scope>
67-
</dependency>
68-
</dependencies>
69-
<build>
70-
<plugins>
71-
<plugin>
72-
<groupId>org.springframework.boot</groupId>
73-
<artifactId>spring-boot-maven-plugin</artifactId>
74-
<version>${spring-boot.version}</version>
75-
<executions>
76-
<execution>
77-
<goals>
78-
<goal>repackage</goal>
79-
</goals>
80-
</execution>
81-
</executions>
82-
</plugin>
83-
<!-- [START cloudrun_helloworld_jib] -->
84-
<plugin>
85-
<groupId>com.google.cloud.tools</groupId>
86-
<artifactId>jib-maven-plugin</artifactId>
87-
<version>3.4.0</version>
88-
<configuration>
89-
<to>
90-
<image>gcr.io/PROJECT_ID/helloworld</image>
91-
</to>
92-
</configuration>
93-
</plugin>
94-
<!-- [END cloudrun_helloworld_jib] -->
95-
</plugins>
96-
</build>
69+
<build>
70+
<plugins>
71+
<plugin>
72+
<groupId>org.springframework.boot</groupId>
73+
<artifactId>spring-boot-maven-plugin</artifactId>
74+
<version>${spring-boot.version}</version>
75+
<executions>
76+
<execution>
77+
<goals>
78+
<goal>repackage</goal>
79+
</goals>
80+
</execution>
81+
</executions>
82+
</plugin>
83+
<!-- [START cloudrun_helloworld_jib] -->
84+
<plugin>
85+
<groupId>com.google.cloud.tools</groupId>
86+
<artifactId>jib-maven-plugin</artifactId>
87+
<version>3.4.0</version>
88+
<configuration>
89+
<to>
90+
<image>gcr.io/PROJECT_ID/helloworld</image>
91+
</to>
92+
</configuration>
93+
</plugin>
94+
<!-- [END cloudrun_helloworld_jib] -->
95+
<plugin>
96+
<groupId>org.jacoco</groupId>
97+
<artifactId>jacoco-maven-plugin</artifactId>
98+
<version>0.8.11</version>
99+
<executions>
100+
<execution>
101+
<goals>
102+
<goal>prepare-agent</goal>
103+
</goals>
104+
</execution>
105+
<execution>
106+
<id>report</id>
107+
<phase>prepare-package</phase>
108+
<goals>
109+
<goal>report</goal>
110+
</goals>
111+
</execution>
112+
</executions>
113+
</plugin>
114+
</plugins>
115+
</build>
97116
</project>

run/helloworld/pom.xml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ limitations under the License.
4141
<properties>
4242
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4343
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
44-
<maven.compiler.target>25</maven.compiler.target>
45-
<maven.compiler.source>25</maven.compiler.source>
46-
<spring-boot.version>3.5.6</spring-boot.version>
44+
<maven.compiler.source>21</maven.compiler.source>
45+
<maven.compiler.release>21</maven.compiler.release>
46+
<spring-boot.version>3.2.2</spring-boot.version>
4747
</properties>
4848
<dependencies>
4949
<dependency>
@@ -92,6 +92,25 @@ limitations under the License.
9292
</configuration>
9393
</plugin>
9494
<!-- [END cloudrun_helloworld_jib] -->
95+
<plugin>
96+
<groupId>org.jacoco</groupId>
97+
<artifactId>jacoco-maven-plugin</artifactId>
98+
<version>0.8.11</version>
99+
<executions>
100+
<execution>
101+
<goals>
102+
<goal>prepare-agent</goal>
103+
</goals>
104+
</execution>
105+
<execution>
106+
<id>report</id>
107+
<phase>prepare-package</phase>
108+
<goals>
109+
<goal>report</goal>
110+
</goals>
111+
</execution>
112+
</executions>
113+
</plugin>
95114
</plugins>
96115
</build>
97116
</project>

0 commit comments

Comments
 (0)