Skip to content

Commit 21fa82a

Browse files
authored
Merge pull request #381 from HSLdevcom/feat/70552_upgrade-to-java-25
feat(70552): upgrade to Java 25
2 parents 652895c + 200e8a2 commit 21fa82a

File tree

12 files changed

+212
-197
lines changed

12 files changed

+212
-197
lines changed

.github/workflows/test-and-build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v3
10-
- name: Set up JDK 11
10+
- name: Set up JDK 25
1111
uses: actions/setup-java@v3
1212
with:
1313
distribution: 'temurin'
14-
java-version: '11'
14+
java-version: '25'
1515
cache: 'maven'
1616
- name: Run Spotless Apply
1717
run: mvn spotless:apply
@@ -28,11 +28,11 @@ jobs:
2828
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
2929
steps:
3030
- uses: actions/checkout@v3
31-
- name: Set up JDK 11
31+
- name: Set up JDK 25
3232
uses: actions/setup-java@v3
3333
with:
3434
distribution: 'temurin'
35-
java-version: '11'
35+
java-version: '25'
3636
cache: 'maven'
3737
- name: Publish package
3838
run: mvn --batch-mode deploy

pom.xml

Lines changed: 39 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,36 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>fi.hsl</groupId>
44
<artifactId>transitdata-common</artifactId>
5-
<version>2.0.5</version>
5+
<version>3.0.0</version>
66
<packaging>jar</packaging>
77
<name>Common utilities for Transitdata projects</name>
8+
89
<properties>
910
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
10-
<maven.compiler.source>11</maven.compiler.source>
11-
<maven.compiler.target>11</maven.compiler.target>
11+
<java.version>25</java.version>
1212
<pulsar.version>3.0.7</pulsar.version>
1313
<testcontainers.version>1.18.3</testcontainers.version>
1414
<spotlessMavenPlugin.version>2.43.0</spotlessMavenPlugin.version>
15-
<googleJavaFormat.version>1.17.0</googleJavaFormat.version>
15+
<googleJavaFormat.version>1.23.0</googleJavaFormat.version>
16+
<jackson.version>2.20.1</jackson.version>
1617
</properties>
1718

1819
<profiles>
19-
<!-- The Configuration of the unit-test profile -->
2020
<profile>
2121
<id>unit-test</id>
2222
<activation>
2323
<activeByDefault>true</activeByDefault>
2424
</activation>
2525
<properties>
26-
<!--
27-
Build profile for unit tests.
28-
Usage: mvn test -P unit-test
29-
-->
3026
<build.profile.id>unit-test</build.profile.id>
3127
<skip.integration.tests>true</skip.integration.tests>
3228
<skip.unit.tests>false</skip.unit.tests>
3329
</properties>
3430
</profile>
35-
<!-- The Configuration of the integration-test profile -->
31+
3632
<profile>
3733
<id>integration-test</id>
3834
<properties>
39-
<!--
40-
Build profile for integration tests.
41-
Usage: mvn verify -P integration-test
42-
-->
4335
<build.profile.id>integration-test</build.profile.id>
4436
<skip.integration.tests>false</skip.integration.tests>
4537
<skip.unit.tests>true</skip.unit.tests>
@@ -61,82 +53,77 @@
6153
<artifactId>protobuf-java</artifactId>
6254
<version>3.21.12</version>
6355
</dependency>
64-
6556
<dependency>
66-
<groupId>com.dslplatform</groupId>
67-
<artifactId>dsl-json-java8</artifactId>
68-
<version>1.10.0</version>
57+
<groupId>com.fasterxml.jackson.core</groupId>
58+
<artifactId>jackson-databind</artifactId>
59+
<version>${jackson.version}</version>
60+
</dependency>
61+
<dependency>
62+
<groupId>com.fasterxml.jackson.core</groupId>
63+
<artifactId>jackson-core</artifactId>
64+
<version>${jackson.version}</version>
65+
</dependency>
66+
<dependency>
67+
<groupId>com.fasterxml.jackson.core</groupId>
68+
<artifactId>jackson-annotations</artifactId>
69+
<version>2.20</version>
70+
</dependency>
71+
<dependency>
72+
<groupId>com.fasterxml.jackson.datatype</groupId>
73+
<artifactId>jackson-datatype-jsr310</artifactId>
74+
<version>${jackson.version}</version>
6975
</dependency>
70-
7176
<dependency>
7277
<groupId>org.apache.pulsar</groupId>
7378
<artifactId>pulsar-client</artifactId>
7479
<version>${pulsar.version}</version>
7580
</dependency>
76-
7781
<dependency>
7882
<groupId>org.apache.pulsar</groupId>
7983
<artifactId>pulsar-client-admin</artifactId>
8084
<version>${pulsar.version}</version>
8185
</dependency>
82-
8386
<dependency>
8487
<groupId>redis.clients</groupId>
8588
<artifactId>jedis</artifactId>
8689
<version>4.4.3</version>
87-
<type>jar</type>
88-
<scope>compile</scope>
8990
</dependency>
90-
9191
<dependency>
9292
<groupId>com.typesafe</groupId>
9393
<artifactId>config</artifactId>
9494
<version>1.4.2</version>
9595
</dependency>
96-
9796
<dependency>
9897
<groupId>ch.qos.logback</groupId>
9998
<artifactId>logback-classic</artifactId>
10099
<version>1.4.7</version>
101100
</dependency>
102-
103101
<dependency>
104102
<groupId>ch.qos.logback.contrib</groupId>
105103
<artifactId>logback-json-classic</artifactId>
106104
<version>0.1.5</version>
107105
</dependency>
108-
109106
<dependency>
110107
<groupId>ch.qos.logback.contrib</groupId>
111108
<artifactId>logback-jackson</artifactId>
112109
<version>0.1.5</version>
113110
</dependency>
114-
115111
<dependency>
116112
<groupId>org.slf4j</groupId>
117113
<artifactId>slf4j-api</artifactId>
118114
<version>2.0.7</version>
119115
</dependency>
120-
121-
<dependency>
122-
<groupId>com.fasterxml.jackson.core</groupId>
123-
<artifactId>jackson-databind</artifactId>
124-
<version>2.15.0</version>
125-
</dependency>
126-
127116
<dependency>
128117
<groupId>org.jetbrains</groupId>
129118
<artifactId>annotations</artifactId>
130119
<version>24.0.1</version>
131120
</dependency>
132-
133121
<dependency>
134122
<groupId>junit</groupId>
135123
<artifactId>junit</artifactId>
136124
<version>4.13.2</version>
137125
<scope>test</scope>
138126
</dependency>
139-
140127
<dependency>
141128
<groupId>org.testcontainers</groupId>
142129
<artifactId>testcontainers</artifactId>
@@ -149,24 +136,32 @@
149136
<version>${testcontainers.version}</version>
150137
<scope>test</scope>
151138
</dependency>
152-
153139
</dependencies>
154140

155141
<build>
156142
<finalName>${project.artifactId}-${project.version}</finalName>
143+
157144
<resources>
158145
<resource>
159146
<directory>src/main/resources</directory>
160147
<filtering>true</filtering>
161148
<excludes>
162-
<!-- exclude logback.xml so that we don't shadow resources for applications using this library -->
163149
<exclude>logback.xml</exclude>
164150
</excludes>
165151
</resource>
166152
</resources>
167153

168154
<plugins>
169155

156+
<plugin>
157+
<groupId>org.apache.maven.plugins</groupId>
158+
<artifactId>maven-compiler-plugin</artifactId>
159+
<version>3.13.0</version>
160+
<configuration>
161+
<release>25</release>
162+
</configuration>
163+
</plugin>
164+
170165
<plugin>
171166
<groupId>org.apache.maven.plugins</groupId>
172167
<artifactId>maven-assembly-plugin</artifactId>
@@ -188,39 +183,11 @@
188183
</execution>
189184
</executions>
190185
</plugin>
191-
<plugin>
192-
<groupId>org.apache.maven.plugins</groupId>
193-
<artifactId>maven-compiler-plugin</artifactId>
194-
<version>3.11.0</version>
195-
<configuration>
196-
<source>11</source>
197-
<target>11</target>
198-
</configuration>
199-
</plugin>
200186

201-
<plugin>
202-
<groupId>com.coderplus.maven.plugins</groupId>
203-
<artifactId>copy-rename-maven-plugin</artifactId>
204-
<version>1.0.1</version>
205-
<executions>
206-
<execution>
207-
<id>copy-and-rename-pom-file</id>
208-
<phase>package</phase>
209-
<goals>
210-
<goal>copy</goal>
211-
</goals>
212-
<configuration>
213-
<sourceFile>${project.basedir}/pom.xml</sourceFile>
214-
<destinationFile>${project.build.directory}/${project.build.finalName}.pom</destinationFile>
215-
</configuration>
216-
</execution>
217-
</executions>
218-
</plugin>
219-
220-
<!-- create a complete jar for testing in other environments -->
221187
<plugin>
222188
<groupId>org.apache.maven.plugins</groupId>
223189
<artifactId>maven-jar-plugin</artifactId>
190+
<version>3.4.1</version>
224191
<executions>
225192
<execution>
226193
<goals>
@@ -229,45 +196,24 @@
229196
</execution>
230197
</executions>
231198
</plugin>
232-
<plugin>
233-
<groupId>org.apache.maven.plugins</groupId>
234-
<artifactId>maven-assembly-plugin</artifactId>
235-
<configuration>
236-
<descriptors>
237-
<descriptor>test-jar-with-dependencies.xml</descriptor>
238-
</descriptors>
239-
</configuration>
240-
<executions>
241-
<execution>
242-
<!--Do not run the assembly plugin twice -->
243-
<!--<phase>package</phase>-->
244-
<goals>
245-
<goal>single</goal>
246-
</goals>
247-
</execution>
248-
</executions>
249-
</plugin>
250199

251200
<plugin>
252201
<groupId>org.codehaus.mojo</groupId>
253202
<artifactId>build-helper-maven-plugin</artifactId>
254203
<version>3.4.0</version>
255204
<executions>
256-
<!-- Add a new source directory to our build -->
257205
<execution>
258206
<id>add-integration-test-sources</id>
259207
<phase>generate-test-sources</phase>
260208
<goals>
261209
<goal>add-test-source</goal>
262210
</goals>
263211
<configuration>
264-
<!-- Configures the source directory of our integration tests -->
265212
<sources>
266213
<source>src/integration-test/java</source>
267214
</sources>
268215
</configuration>
269216
</execution>
270-
<!-- Add a new resource directory to our build -->
271217
<execution>
272218
<id>add-integration-test-resources</id>
273219
<phase>generate-test-resources</phase>
@@ -277,13 +223,12 @@
277223
<configuration>
278224
<resources>
279225
<resource>
280-
<filtering>true</filtering>
281226
<directory>src/integration-test/resources</directory>
227+
<filtering>true</filtering>
282228
</resource>
283229
</resources>
284230
</configuration>
285231
</execution>
286-
287232
</executions>
288233
</plugin>
289234

@@ -293,7 +238,6 @@
293238
<version>3.1.2</version>
294239
<configuration>
295240
<skipTests>${skip.unit.tests}</skipTests>
296-
<!-- Excludes integration tests when unit tests are run -->
297241
<excludes>
298242
<exclude>**/IT*.java</exclude>
299243
</excludes>
@@ -306,6 +250,7 @@
306250
</environmentVariables>
307251
</configuration>
308252
</plugin>
253+
309254
<plugin>
310255
<groupId>org.apache.maven.plugins</groupId>
311256
<artifactId>maven-failsafe-plugin</artifactId>
@@ -323,6 +268,7 @@
323268
</execution>
324269
</executions>
325270
</plugin>
271+
326272
<plugin>
327273
<groupId>com.diffplug.spotless</groupId>
328274
<artifactId>spotless-maven-plugin</artifactId>
@@ -349,6 +295,7 @@
349295
</execution>
350296
</executions>
351297
</plugin>
298+
352299
</plugins>
353300
</build>
354301
</project>

0 commit comments

Comments
 (0)