Skip to content

Commit 585013d

Browse files
author
Mikalai Alimenkou
committed
Migrated to Spring Boot 3.5.6
1 parent 2a25495 commit 585013d

18 files changed

+125
-90
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
2-
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
1+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
2+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar

Dockerfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
FROM eclipse-temurin:21.0.2_13-jdk-alpine as builder
1+
FROM eclipse-temurin:24.0.2_12-jdk-alpine AS builder
22
ARG JAR_FILE=target/*.jar
33
COPY ${JAR_FILE} library.jar
4-
RUN java -Djarmode=layertools -jar library.jar extract
4+
RUN java -jar -Djarmode=tools library.jar extract --layers --destination library
55

6-
FROM eclipse-temurin:21.0.2_13-jdk-alpine
7-
VOLUME /tmp
8-
COPY --from=builder dependencies/ ./
9-
COPY --from=builder snapshot-dependencies/ ./
10-
COPY --from=builder spring-boot-loader/ ./
11-
COPY --from=builder application/ ./
12-
ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"]
6+
FROM eclipse-temurin:24.0.2_12-jdk-alpine
7+
COPY --from=builder /library/dependencies/ ./
8+
COPY --from=builder /library/snapshot-dependencies/ ./
9+
COPY --from=builder /library/spring-boot-loader/ ./
10+
COPY --from=builder /library/application/ ./
11+
ENTRYPOINT ["java", "-jar", "library.jar"]

Dockerfile_basic

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
FROM eclipse-temurin:21.0.2_13-jdk-alpine
2-
VOLUME /tmp
1+
FROM eclipse-temurin:24.0.2_12-jdk-alpine
32
COPY target/*.jar library.jar
43
ENTRYPOINT ["java","-jar","/library.jar"]

Dockerfile_full

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
FROM maven:3.9.6-eclipse-temurin-21-alpine AS maven_dependencies
1+
FROM maven:3.9.6-eclipse-temurin-24-alpine AS maven_dependencies
22
COPY pom.xml /tmp/
33
RUN mvn -B dependency:go-offline -f /tmp/pom.xml -s /usr/share/maven/ref/settings-docker.xml
44

5-
FROM maven_dependencies as maven_build
5+
FROM maven_dependencies AS maven_build
66
COPY src /tmp/src/
77
COPY .git /tmp/.git/
88
COPY lombok.config /tmp/
99
WORKDIR /tmp/
1010
RUN mvn -B -s /usr/share/maven/ref/settings-docker.xml package -DskipTests
1111
ARG JAR_FILE=target/*.jar
1212
COPY ${JAR_FILE} library.jar
13-
RUN java -Djarmode=layertools -jar library.jar extract
13+
RUN java -jar -Djarmode=tools library.jar extract --layers --destination library
1414

15-
FROM eclipse-temurin:21.0.2_13-jdk-alpine
16-
VOLUME /tmp
17-
COPY --from=maven_build /tmp/dependencies/ ./
18-
COPY --from=maven_build /tmp/snapshot-dependencies/ ./
19-
COPY --from=maven_build /tmp/spring-boot-loader/ ./
20-
COPY --from=maven_build /tmp/application/ ./
21-
ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"]
15+
FROM eclipse-temurin:24.0.2_12-jdk-alpine
16+
COPY --from=maven_build /tmp/library/dependencies/ ./
17+
COPY --from=maven_build /tmp/library/snapshot-dependencies/ ./
18+
COPY --from=maven_build /tmp/library/spring-boot-loader/ ./
19+
COPY --from=maven_build /tmp/library/application/ ./
20+
ENTRYPOINT ["java", "-jar", "library.jar"]

compose.yaml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
1-
version: '3'
2-
31
services:
4-
library-db:
5-
image: postgres:11
2+
db:
3+
image: postgres:17.6
64
container_name: postgresql
75
environment:
86
POSTGRES_DB: library
97
POSTGRES_USER: test
108
POSTGRES_PASSWORD: test
119
ports:
1210
- "5432:5432"
13-
labels:
14-
org.springframework.boot.ignore: true
1511

1612
jaeger:
17-
image: jaegertracing/all-in-one:latest
13+
image: cr.jaegertracing.io/jaegertracing/jaeger:2.10.0
14+
container_name: jaeger
1815
ports:
19-
- "5775:5775/udp"
20-
- "6831:6831/udp"
21-
- "6832:6832/udp"
22-
- "5778:5778"
23-
- "16686:16686"
24-
- "14268:14268"
25-
- "14250:14250"
26-
- "9411:9411"
27-
environment:
28-
- COLLECTOR_ZIPKIN_HOST_PORT=:9411
16+
- "16686:16686" # Jaeger UI
17+
- "4317:4317" # OTLP gRPC ingest
18+
- "4318:4318" # OTLP HTTP ingest
19+
- "5778:5778" # Remote sampling (HTTP)
20+
- "9411:9411" # Zipkin compatible ingest (optional)
21+
restart: unless-stopped

pom.xml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
<parent>
1515
<groupId>org.springframework.boot</groupId>
1616
<artifactId>spring-boot-starter-parent</artifactId>
17-
<version>3.2.4</version>
17+
<version>3.5.6</version>
1818
<relativePath/> <!-- lookup parent from repository -->
1919
</parent>
2020

2121
<properties>
2222
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2323
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24-
<java.version>21</java.version>
24+
<java.version>24</java.version>
2525
<pact.provider.version>0.1.0</pact.provider.version>
2626
<pact.provider.branch>master</pact.provider.branch>
2727
<pact.publish.results>false</pact.publish.results>
@@ -85,12 +85,12 @@
8585
<dependency>
8686
<groupId>net.ttddyy.observation</groupId>
8787
<artifactId>datasource-micrometer-spring-boot</artifactId>
88-
<version>1.0.3</version>
88+
<version>1.2.0</version>
8989
</dependency>
90-
<!--<dependency>
90+
<dependency>
9191
<groupId>io.opentelemetry</groupId>
9292
<artifactId>opentelemetry-exporter-zipkin</artifactId>
93-
</dependency>-->
93+
</dependency>
9494

9595
<dependency>
9696
<groupId>org.apache.commons</groupId>
@@ -99,7 +99,7 @@
9999
<dependency>
100100
<groupId>com.google.guava</groupId>
101101
<artifactId>guava</artifactId>
102-
<version>33.1.0-jre</version>
102+
<version>33.5.0-jre</version>
103103
</dependency>
104104
<dependency>
105105
<groupId>org.springframework.boot</groupId>
@@ -110,9 +110,14 @@
110110
<groupId>org.flywaydb</groupId>
111111
<artifactId>flyway-core</artifactId>
112112
</dependency>
113+
<dependency>
114+
<groupId>org.flywaydb</groupId>
115+
<artifactId>flyway-database-postgresql</artifactId>
116+
</dependency>
113117
<dependency>
114118
<groupId>org.projectlombok</groupId>
115119
<artifactId>lombok</artifactId>
120+
<scope>provided</scope>
116121
<optional>true</optional>
117122
</dependency>
118123
<dependency>
@@ -126,17 +131,17 @@
126131
<dependency>
127132
<groupId>net.logstash.logback</groupId>
128133
<artifactId>logstash-logback-encoder</artifactId>
129-
<version>6.6</version>
134+
<version>8.1</version>
130135
</dependency>
131136
<dependency>
132137
<groupId>org.springdoc</groupId>
133138
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
134-
<version>2.5.0</version>
139+
<version>2.8.13</version>
135140
</dependency>
136141
<dependency>
137142
<groupId>org.springdoc</groupId>
138143
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
139-
<version>2.5.0</version>
144+
<version>2.8.13</version>
140145
</dependency>
141146

142147
<dependency>
@@ -155,20 +160,20 @@
155160
<scope>test</scope>
156161
</dependency>
157162
<dependency>
158-
<groupId>net.sourceforge.htmlunit</groupId>
163+
<groupId>org.htmlunit</groupId>
159164
<artifactId>htmlunit</artifactId>
160165
<scope>test</scope>
161166
</dependency>
162167
<dependency>
163168
<groupId>com.github.database-rider</groupId>
164169
<artifactId>rider-core</artifactId>
165-
<version>1.42.0</version>
170+
<version>1.44.0</version>
166171
<scope>test</scope>
167172
</dependency>
168173
<dependency>
169174
<groupId>com.github.database-rider</groupId>
170175
<artifactId>rider-spring</artifactId>
171-
<version>1.42.0</version>
176+
<version>1.44.0</version>
172177
<scope>test</scope>
173178
</dependency>
174179
<dependency>
@@ -190,19 +195,19 @@
190195
<dependency>
191196
<groupId>com.tngtech.archunit</groupId>
192197
<artifactId>archunit-junit5</artifactId>
193-
<version>1.3.0</version>
198+
<version>1.4.1</version>
194199
<scope>test</scope>
195200
</dependency>
196201
<dependency>
197202
<groupId>au.com.dius.pact.provider</groupId>
198203
<artifactId>junit5spring</artifactId>
199-
<version>4.6.8</version>
204+
<version>4.6.17</version>
200205
<scope>test</scope>
201206
</dependency>
202207
<dependency>
203208
<groupId>org.openapitools.openapidiff</groupId>
204209
<artifactId>openapi-diff-core</artifactId>
205-
<version>2.0.1</version>
210+
<version>2.1.3</version>
206211
<scope>test</scope>
207212
</dependency>
208213
<dependency>
@@ -222,6 +227,7 @@
222227
<layers>
223228
<enabled>true</enabled>
224229
</layers>
230+
<includeTools>true</includeTools>
225231
<image>
226232
<name>xpinjection.com/library:0.1.0</name>
227233
</image>
@@ -255,6 +261,19 @@
255261
</systemPropertyVariables>
256262
</configuration>
257263
</plugin>
264+
<plugin>
265+
<groupId>org.apache.maven.plugins</groupId>
266+
<artifactId>maven-compiler-plugin</artifactId>
267+
<configuration>
268+
<annotationProcessorPaths>
269+
<path>
270+
<groupId>org.projectlombok</groupId>
271+
<artifactId>lombok</artifactId>
272+
</path>
273+
</annotationProcessorPaths>
274+
<parameters>true</parameters>
275+
</configuration>
276+
</plugin>
258277
<plugin>
259278
<groupId>io.github.git-commit-id</groupId>
260279
<artifactId>git-commit-id-maven-plugin</artifactId>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.xpinjection.library.service.dto;
22

3-
import lombok.NonNull;
3+
import lombok.RequiredArgsConstructor;
44
import lombok.Value;
55

66
@Value
7+
@RequiredArgsConstructor
78
public class Recommendation {
8-
@NonNull
99
String sentence;
1010
}

src/main/resources/application-admin.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,28 @@ spring:
1111
enabled: true
1212

1313
management:
14+
otlp:
15+
logging:
16+
export:
17+
enabled: false
18+
tracing:
19+
endpoint: http://localhost:4318/v1/traces
20+
export:
21+
enabled: true
22+
logging:
23+
export:
24+
enabled: false
1425
tracing:
26+
enabled: true
1527
sampling:
1628
probability: 1.0
1729
endpoint:
1830
env:
1931
show-values: when_authorized
2032
shutdown:
21-
enabled: true
33+
access: unrestricted
34+
heapdump:
35+
access: unrestricted
2236
health:
2337
show-details: always
2438
show-components: always
@@ -30,14 +44,15 @@ management:
3044
configprops:
3145
show-values: when_authorized
3246
endpoints:
47+
access:
48+
default: unrestricted
3349
jmx:
3450
exposure:
3551
include: '*'
3652
web:
3753
base-path: /admin
3854
exposure:
3955
include: '*'
40-
enabled-by-default: true
4156
info:
4257
java:
4358
enabled: true
@@ -46,4 +61,6 @@ management:
4661
git:
4762
mode: full
4863
os:
64+
enabled: true
65+
process:
4966
enabled: true

src/main/resources/application.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ server:
1010
max-connections: 30
1111
threads:
1212
max: 30
13+
max-queue-capacity: 1000
1314
basedir: tomcat
1415
accesslog:
1516
enabled: true
@@ -22,6 +23,7 @@ server:
2223
enabled: false
2324
http2:
2425
enabled: true
26+
shutdown: immediate
2527

2628
spring:
2729
docker:
@@ -33,11 +35,13 @@ spring:
3335
mode: never
3436
application:
3537
name: library
38+
group: xpinjection
3639
jackson:
3740
serialization:
3841
indent_output: true
3942
deserialization:
4043
fail-on-unknown-properties: true
44+
constructor-detector: use_delegating
4145
freemarker:
4246
enabled: true
4347
cache: true
@@ -73,6 +77,7 @@ library:
7377
size: 0
7478

7579
logging:
80+
include-application-group: false
7681
include-application-name: false
7782
file:
7883
name: library.log
@@ -87,5 +92,8 @@ springdoc:
8792
name: generated
8893

8994
management:
95+
tracing:
96+
enabled: false
9097
endpoints:
91-
enabled-by-default: false
98+
access:
99+
default: none

0 commit comments

Comments
 (0)