Skip to content

Commit

Permalink
migrated on Spring Boot 3.2.4 and Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
xpinjection committed Apr 16, 2024
1 parent 98ec7da commit c6b68e8
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 29 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM openjdk:17.0.2-slim as builder
FROM eclipse-temurin:21.0.2_13-jdk-alpine as builder
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} library.jar
RUN java -Djarmode=layertools -jar library.jar extract

FROM openjdk:17.0.2-slim
FROM eclipse-temurin:21.0.2_13-jdk-alpine
VOLUME /tmp
COPY --from=builder dependencies/ ./
COPY --from=builder snapshot-dependencies/ ./
COPY --from=builder spring-boot-loader/ ./
COPY --from=builder application/ ./
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"]
2 changes: 1 addition & 1 deletion Dockerfile_basic
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:17.0.2-slim
FROM eclipse-temurin:21.0.2_13-jdk-alpine
VOLUME /tmp
COPY target/*.jar library.jar
ENTRYPOINT ["java","-jar","/library.jar"]
6 changes: 3 additions & 3 deletions Dockerfile_full
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM maven:3.8.7-eclipse-temurin-17-alpine AS maven_dependencies
FROM maven:3.9.6-eclipse-temurin-21-alpine AS maven_dependencies
COPY pom.xml /tmp/
RUN mvn -B dependency:go-offline -f /tmp/pom.xml -s /usr/share/maven/ref/settings-docker.xml

Expand All @@ -12,10 +12,10 @@ ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} library.jar
RUN java -Djarmode=layertools -jar library.jar extract

FROM openjdk:17.0.2-slim
FROM eclipse-temurin:21.0.2_13-jdk-alpine
VOLUME /tmp
COPY --from=maven_build /tmp/dependencies/ ./
COPY --from=maven_build /tmp/snapshot-dependencies/ ./
COPY --from=maven_build /tmp/spring-boot-loader/ ./
COPY --from=maven_build /tmp/application/ ./
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"]
20 changes: 10 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.4</version>
<version>3.2.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<java.version>21</java.version>
<pact.provider.version>0.1.0</pact.provider.version>
<pact.provider.branch>master</pact.provider.branch>
<pact.publish.results>false</pact.publish.results>
Expand Down Expand Up @@ -85,7 +85,7 @@
<dependency>
<groupId>net.ttddyy.observation</groupId>
<artifactId>datasource-micrometer-spring-boot</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
</dependency>
<!--<dependency>
<groupId>io.opentelemetry</groupId>
Expand All @@ -99,7 +99,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.0.1-jre</version>
<version>33.1.0-jre</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -131,12 +131,12 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.2.0</version>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
<version>2.2.0</version>
<version>2.5.0</version>
</dependency>

<dependency>
Expand All @@ -162,13 +162,13 @@
<dependency>
<groupId>com.github.database-rider</groupId>
<artifactId>rider-core</artifactId>
<version>1.41.0</version>
<version>1.42.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.database-rider</groupId>
<artifactId>rider-spring</artifactId>
<version>1.41.0</version>
<version>1.42.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -190,13 +190,13 @@
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit5</artifactId>
<version>1.2.1</version>
<version>1.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>au.com.dius.pact.provider</groupId>
<artifactId>junit5spring</artifactId>
<version>4.6.3</version>
<version>4.6.8</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
6 changes: 1 addition & 5 deletions src/main/resources/application-admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,4 @@ management:
git:
mode: full
os:
enabled: true

logging:
pattern:
level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]"
enabled: true
1 change: 1 addition & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ library:
size: 0

logging:
include-application-name: false
file:
name: library.log

Expand Down
14 changes: 7 additions & 7 deletions src/test/resources/datasets/database.dtd
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<!ELEMENT dataset (
expert*,
book*,
expert*,
recommendations*)>

<!ELEMENT expert EMPTY>
<!ATTLIST expert
<!ELEMENT book EMPTY>
<!ATTLIST book
id CDATA #REQUIRED
name CDATA #REQUIRED
contact CDATA #REQUIRED
author CDATA #REQUIRED
>

<!ELEMENT book EMPTY>
<!ATTLIST book
<!ELEMENT expert EMPTY>
<!ATTLIST expert
id CDATA #REQUIRED
name CDATA #REQUIRED
author CDATA #REQUIRED
contact CDATA #REQUIRED
>

<!ELEMENT recommendations EMPTY>
Expand Down

0 comments on commit c6b68e8

Please sign in to comment.