From c5bd0c83cf233b60224b565cd2a91580fe6f0a60 Mon Sep 17 00:00:00 2001 From: Joachim Schlienger Date: Mon, 12 Aug 2024 09:21:05 +0200 Subject: [PATCH 1/7] feat(CHIST-9921): fix java17 --- .idea/encodings.xml | 4 ++- pom.xml | 28 +++++++++++-------- .../corellia/api/ContractRestController.java | 14 +++++----- .../baloise/corellia/api/entities/Action.java | 2 +- .../corellia/api/entities/Address.java | 4 +-- .../baloise/corellia/api/entities/Agent.java | 4 +-- .../corellia/api/entities/Cancellation.java | 4 +-- .../corellia/api/entities/Company.java | 4 +-- .../corellia/api/entities/Contract.java | 6 ++-- .../corellia/api/entities/Coverable.java | 6 ++-- .../corellia/api/entities/Coverage.java | 2 +- .../corellia/api/entities/Document.java | 4 +-- .../corellia/api/entities/ErrorResponse.java | 2 +- .../corellia/api/entities/FileHandle.java | 2 +- .../corellia/api/entities/Identifier.java | 2 +- .../corellia/api/entities/MonetaryAmount.java | 2 +- .../corellia/api/entities/Payment.java | 2 +- .../baloise/corellia/api/entities/Person.java | 4 +-- .../corellia/api/entities/PhoneNumber.java | 4 +-- .../corellia/api/entities/Product.java | 6 ++-- .../baloise/corellia/api/entities/Role.java | 4 +-- .../corellia/api/entities/TermsOfService.java | 2 +- .../corellia/api/entities/Version.java | 2 +- 23 files changed, 60 insertions(+), 54 deletions(-) diff --git a/.idea/encodings.xml b/.idea/encodings.xml index 016dea0..af673e7 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -2,5 +2,7 @@ + + - + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 0e7ad5d..75b302d 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ ch.baloise.corellia - api + api-jakarta 3.0.0 jar @@ -52,11 +52,10 @@ UTF-8 - 1.8 - 1.8 - 2.1.0 + 17 + 17 + 2.2.22 2.10.0.pr1 - 2.1 @@ -103,7 +102,7 @@ io.swagger.core.v3 - swagger-jaxrs2 + swagger-jaxrs2-jakarta compile ${swagger.version} true @@ -127,11 +126,16 @@ true - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api.version} + jakarta.ws.rs + jakarta.ws.rs-api + 4.0.0 true + + org.slf4j + slf4j-simple + 2.0.13 + com.fasterxml.jackson.core jackson-databind @@ -139,9 +143,9 @@ true - javax.servlet - javax.servlet-api - 3.1.0 + jakarta.servlet + jakarta.servlet-api + 6.1.0 true diff --git a/src/main/java/ch/baloise/corellia/api/ContractRestController.java b/src/main/java/ch/baloise/corellia/api/ContractRestController.java index 58b9357..b4a96f3 100644 --- a/src/main/java/ch/baloise/corellia/api/ContractRestController.java +++ b/src/main/java/ch/baloise/corellia/api/ContractRestController.java @@ -25,13 +25,13 @@ import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; @Path("/contracts") @Consumes(MediaType.APPLICATION_JSON + "; charset=UTF-8") diff --git a/src/main/java/ch/baloise/corellia/api/entities/Action.java b/src/main/java/ch/baloise/corellia/api/entities/Action.java index e676f58..a8aaee4 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Action.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Action.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.time.LocalDate; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class Action { diff --git a/src/main/java/ch/baloise/corellia/api/entities/Address.java b/src/main/java/ch/baloise/corellia/api/entities/Address.java index 68ebf0d..9e070ae 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Address.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Address.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.io.Serializable; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; public class Address implements Serializable { diff --git a/src/main/java/ch/baloise/corellia/api/entities/Agent.java b/src/main/java/ch/baloise/corellia/api/entities/Agent.java index ce8791c..93655a7 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Agent.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Agent.java @@ -17,8 +17,8 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.io.Serializable; import static ch.baloise.corellia.api.constraints.SizeConstraint.*; diff --git a/src/main/java/ch/baloise/corellia/api/entities/Cancellation.java b/src/main/java/ch/baloise/corellia/api/entities/Cancellation.java index 5988b48..9e6f02f 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Cancellation.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Cancellation.java @@ -1,8 +1,8 @@ package ch.baloise.corellia.api.entities; import java.io.Serializable; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; public class Cancellation implements Serializable { diff --git a/src/main/java/ch/baloise/corellia/api/entities/Company.java b/src/main/java/ch/baloise/corellia/api/entities/Company.java index 5051951..0a1cb41 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Company.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Company.java @@ -30,8 +30,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.io.Serializable; import java.util.Arrays; -import javax.validation.Valid; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; public class Company implements Serializable { diff --git a/src/main/java/ch/baloise/corellia/api/entities/Contract.java b/src/main/java/ch/baloise/corellia/api/entities/Contract.java index ef40ac8..883dac7 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Contract.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Contract.java @@ -23,9 +23,9 @@ import java.io.Serializable; import java.time.LocalDate; import java.util.List; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; public class Contract implements Serializable { diff --git a/src/main/java/ch/baloise/corellia/api/entities/Coverable.java b/src/main/java/ch/baloise/corellia/api/entities/Coverable.java index 04d62a1..7c55680 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Coverable.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Coverable.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.io.Serializable; import java.util.List; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; public class Coverable implements Serializable { diff --git a/src/main/java/ch/baloise/corellia/api/entities/Coverage.java b/src/main/java/ch/baloise/corellia/api/entities/Coverage.java index 2b600a9..a18defa 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Coverage.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Coverage.java @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.Serializable; public class Coverage implements Serializable { diff --git a/src/main/java/ch/baloise/corellia/api/entities/Document.java b/src/main/java/ch/baloise/corellia/api/entities/Document.java index b6568c8..8cec6a9 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Document.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Document.java @@ -26,8 +26,8 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import org.apache.commons.lang3.StringUtils; public class Document implements Serializable { diff --git a/src/main/java/ch/baloise/corellia/api/entities/ErrorResponse.java b/src/main/java/ch/baloise/corellia/api/entities/ErrorResponse.java index d271b4f..3a35df2 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/ErrorResponse.java +++ b/src/main/java/ch/baloise/corellia/api/entities/ErrorResponse.java @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.List; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class ErrorResponse { diff --git a/src/main/java/ch/baloise/corellia/api/entities/FileHandle.java b/src/main/java/ch/baloise/corellia/api/entities/FileHandle.java index 0b1a444..8d38423 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/FileHandle.java +++ b/src/main/java/ch/baloise/corellia/api/entities/FileHandle.java @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class FileHandle { diff --git a/src/main/java/ch/baloise/corellia/api/entities/Identifier.java b/src/main/java/ch/baloise/corellia/api/entities/Identifier.java index 69b8ea3..61f546e 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Identifier.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Identifier.java @@ -7,7 +7,7 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import org.apache.commons.lang3.StringUtils; public class Identifier { diff --git a/src/main/java/ch/baloise/corellia/api/entities/MonetaryAmount.java b/src/main/java/ch/baloise/corellia/api/entities/MonetaryAmount.java index 3ad35fd..902882c 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/MonetaryAmount.java +++ b/src/main/java/ch/baloise/corellia/api/entities/MonetaryAmount.java @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.math.BigDecimal; public class MonetaryAmount { diff --git a/src/main/java/ch/baloise/corellia/api/entities/Payment.java b/src/main/java/ch/baloise/corellia/api/entities/Payment.java index 298fecc..30ed2b6 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Payment.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Payment.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.time.LocalDate; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class Payment { diff --git a/src/main/java/ch/baloise/corellia/api/entities/Person.java b/src/main/java/ch/baloise/corellia/api/entities/Person.java index 1c6d098..1dd4d60 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Person.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Person.java @@ -27,8 +27,8 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.io.Serializable; import java.time.LocalDate; -import javax.validation.Valid; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; public class Person implements Serializable { diff --git a/src/main/java/ch/baloise/corellia/api/entities/PhoneNumber.java b/src/main/java/ch/baloise/corellia/api/entities/PhoneNumber.java index 991894e..726366c 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/PhoneNumber.java +++ b/src/main/java/ch/baloise/corellia/api/entities/PhoneNumber.java @@ -17,8 +17,8 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import static ch.baloise.corellia.api.constraints.SizeConstraint.PHONE_NUMBER_MAX_SIZE; import static ch.baloise.corellia.api.constraints.SizeConstraint.PHONE_NUMBER_MIN_SIZE; diff --git a/src/main/java/ch/baloise/corellia/api/entities/Product.java b/src/main/java/ch/baloise/corellia/api/entities/Product.java index a5fca26..5bd3f7d 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Product.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Product.java @@ -17,9 +17,9 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.io.Serializable; import java.util.List; diff --git a/src/main/java/ch/baloise/corellia/api/entities/Role.java b/src/main/java/ch/baloise/corellia/api/entities/Role.java index 7c589c5..bc6d14d 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Role.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Role.java @@ -15,8 +15,8 @@ */ package ch.baloise.corellia.api.entities; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import java.io.Serializable; public class Role implements Serializable { diff --git a/src/main/java/ch/baloise/corellia/api/entities/TermsOfService.java b/src/main/java/ch/baloise/corellia/api/entities/TermsOfService.java index a11eb3e..332286a 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/TermsOfService.java +++ b/src/main/java/ch/baloise/corellia/api/entities/TermsOfService.java @@ -1,7 +1,7 @@ package ch.baloise.corellia.api.entities; import com.fasterxml.jackson.annotation.JsonPropertyDescription; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class TermsOfService { diff --git a/src/main/java/ch/baloise/corellia/api/entities/Version.java b/src/main/java/ch/baloise/corellia/api/entities/Version.java index 330e6c5..f8ea904 100644 --- a/src/main/java/ch/baloise/corellia/api/entities/Version.java +++ b/src/main/java/ch/baloise/corellia/api/entities/Version.java @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.Objects; public class Version { From ed82266228e54fe1bf4796889ed87393a38d8283 Mon Sep 17 00:00:00 2001 From: Joachim Schlienger Date: Mon, 12 Aug 2024 09:55:47 +0200 Subject: [PATCH 2/7] feat(CHIST-9921): fix java17 actions --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a46c06..6d413c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,6 @@ jobs: - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 17 - name: Build with Maven run: mvn clean verify --file pom.xml From 13d8cadf9400af4ee831063f08e5e7f59252236d Mon Sep 17 00:00:00 2001 From: Joachim Schlienger Date: Mon, 12 Aug 2024 11:08:38 +0200 Subject: [PATCH 3/7] feat(CHIST-9921): fix action versions --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d413c7..8291057 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,9 +8,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 with: java-version: 17 - name: Build with Maven From 2c6e92b8b062a1396eb0b9fc950cc6da2e34c89b Mon Sep 17 00:00:00 2001 From: Joachim Schlienger Date: Mon, 12 Aug 2024 11:11:13 +0200 Subject: [PATCH 4/7] feat(CHIST-9921): fix action versions back to v1 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8291057..b69e736 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,9 +8,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v1 - name: Set up JDK - uses: actions/setup-java@v4 + uses: actions/setup-java@v1 with: java-version: 17 - name: Build with Maven From 5c6660b7f12b97deb4471884777c7e29d35264e4 Mon Sep 17 00:00:00 2001 From: Joachim Schlienger Date: Mon, 12 Aug 2024 11:13:18 +0200 Subject: [PATCH 5/7] feat(CHIST-9921): fix action/setup-java to v4 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b69e736..2d9933d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Set up JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 17 - name: Build with Maven From 94fff101fc8bd0151aa6b496208e7036fc2558d8 Mon Sep 17 00:00:00 2001 From: Joachim Schlienger Date: Mon, 12 Aug 2024 11:17:59 +0200 Subject: [PATCH 6/7] feat(CHIST-9921): fix action/setup-java use distribution and cache --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d9933d..b5b68fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: + distribution: 'temurin' java-version: 17 + cache: 'maven' - name: Build with Maven run: mvn clean verify --file pom.xml From c4cc7cbf7947345b56a6795877e9177179bc7f2f Mon Sep 17 00:00:00 2001 From: Joachim Schlienger Date: Mon, 12 Aug 2024 11:20:40 +0200 Subject: [PATCH 7/7] feat(CHIST-9921): fix action/checkout us v4 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5b68fb..bf95ce5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Set up JDK uses: actions/setup-java@v4 with: