Skip to content

Commit 3bb0399

Browse files
authored
Bump Quarkus from 2.15.2.Final to 3.0.0.Alpha2 (#248)
1 parent 190ba4a commit 3bb0399

File tree

76 files changed

+293
-372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+293
-372
lines changed

.github/workflows/latest-stable-compatibility-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
json-provider: [ "jackson-classic", "jsonb-classic", "jackson-reactive", "jsonb-reactive" ]
14-
quarkus-version: [ "2.0", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14"]
14+
quarkus-version: [ "3.0" ]
1515

1616
steps:
1717
- uses: actions/checkout@v2
@@ -32,7 +32,7 @@ jobs:
3232
3333
- name: Integration Tests (lastest - classic - jackson)
3434
env:
35-
LATEST_STABLE_EXTENSION_VERSION: "2.1.0"
35+
LATEST_STABLE_EXTENSION_VERSION: "3.0.0.Alpha2"
3636
run: |
3737
echo "Checking quarkus-resteasy-problem $LATEST_STABLE_EXTENSION_VERSION with Quarkus v${{ matrix.quarkus-version }}"
3838
./mvnw clean verify \

README.md

Lines changed: 52 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
[RFC7807 Problem](https://tools.ietf.org/html/rfc7807) extension for Quarkus RESTeasy/JaxRS applications. It maps Exceptions to `application/problem+json` HTTP responses. Inspired by [Zalando Problem library](https://github.com/zalando/problem).
1919

2020
This extension supports:
21-
- Quarkus 1.X and 2.X
21+
- Quarkus 1, 2 and 3
2222
- `quarkus-resteasy-jackson` and `quarkus-resteasy-jsonb`
2323
- `quarkus-resteasy-reactive-jackson` and `quarkus-resteasy-reactive-jsonb`
2424
- JVM and native mode
@@ -44,46 +44,73 @@ so-called "HTTP APIs" are usually not.
4444
```
4545

4646
## Usage
47-
### Quarkus 2.X / Java 11+
48-
Make sure JDK 11 is in your PATH, the run:
47+
### Quarkus 3.X / Java 11+
48+
Make sure JDK 11 is in your PATH, then run:
4949
```shell
50-
mvn io.quarkus:quarkus-maven-plugin:2.15.2.Final:create \
50+
mvn io.quarkus:quarkus-maven-plugin:3.0.0.Alpha2:create \
5151
-DprojectGroupId=problem \
5252
-DprojectArtifactId=quarkus-resteasy-problem-playground \
5353
-DclassName="problem.HelloResource" \
5454
-Dpath="/hello" \
5555
-Dextensions="resteasy,resteasy-jackson"
5656
cd quarkus-resteasy-problem-playground
57-
./mvnw quarkus:add-extension -Dextensions="com.tietoevry.quarkus:quarkus-resteasy-problem:2.1.0"
57+
./mvnw quarkus:add-extension -Dextensions="com.tietoevry.quarkus:quarkus-resteasy-problem:3.0.0.Alpha2"
5858
```
5959
Or add the following dependency to `pom.xml` in existing project:
6060
```xml
6161
<dependency>
6262
<groupId>com.tietoevry.quarkus</groupId>
6363
<artifactId>quarkus-resteasy-problem</artifactId>
64-
<version>2.1.0</version>
64+
<version>3.0.0.Alpha2</version>
6565
</dependency>
6666
```
6767

68-
### Quarkus 1.X / Java 1.8+
69-
Create a new Quarkus project with the following command:
70-
```shell
71-
mvn io.quarkus:quarkus-maven-plugin:1.13.7.Final:create \
72-
-DprojectGroupId=problem \
73-
-DprojectArtifactId=quarkus-resteasy-problem-playground \
74-
-DclassName="problem.HelloResource" \
75-
-Dpath="/hello" \
76-
-Dextensions="resteasy,resteasy-jackson,com.tietoevry.quarkus:quarkus-resteasy-problem:1.0.0"
77-
cd quarkus-resteasy-problem-playground
78-
```
79-
or
80-
```xml
81-
<dependency>
68+
<details>
69+
<summary>Quarkus 2.X / Java 11+</summary>
70+
71+
Make sure JDK 11 is in your PATH, then run:
72+
```shell
73+
mvn io.quarkus:quarkus-maven-plugin:2.15.2.Final:create \
74+
-DprojectGroupId=problem \
75+
-DprojectArtifactId=quarkus-resteasy-problem-playground \
76+
-DclassName="problem.HelloResource" \
77+
-Dpath="/hello" \
78+
-Dextensions="resteasy,resteasy-jackson"
79+
cd quarkus-resteasy-problem-playground
80+
./mvnw quarkus:add-extension -Dextensions="com.tietoevry.quarkus:quarkus-resteasy-problem:2.1.0
81+
```
82+
Or add the following dependency to `pom.xml` in existing project:
83+
```xml
84+
<dependency>
85+
<groupId>com.tietoevry.quarkus</groupId>
86+
<artifactId>quarkus-resteasy-problem</artifactId>
87+
<version>2.1.0</version>
88+
</dependency>
89+
```
90+
</details>
91+
92+
<details>
93+
<summary>Quarkus 1.X / Java 1.8+</summary>
94+
95+
Create a new Quarkus project with the following command:
96+
```shell
97+
mvn io.quarkus:quarkus-maven-plugin:1.13.7.Final:create \
98+
-DprojectGroupId=problem \
99+
-DprojectArtifactId=quarkus-resteasy-problem-playground \
100+
-DclassName="problem.HelloResource" \
101+
-Dpath="/hello" \
102+
-Dextensions="resteasy,resteasy-jackson,com.tietoevry.quarkus:quarkus-resteasy-problem:1.0.0"
103+
cd quarkus-resteasy-problem-playground
104+
```
105+
Or add the following dependency to `pom.xml` in existing project:
106+
```xml
107+
<dependency>
82108
<groupId>com.tietoevry.quarkus</groupId>
83109
<artifactId>quarkus-resteasy-problem</artifactId>
84110
<version>1.0.0</version>
85-
</dependency>
86-
```
111+
</dependency>
112+
```
113+
</details>
87114
88115
**Hint:** you can also use `resteasy-jsonb` or reactive equivalents: `resteasy-reactive-jackson` / `resteasy-reactive-jsonb` instead of `resteasy-jackson`
89116
@@ -99,9 +126,9 @@ Now you can throw `HttpProblem`s (using builder or a subclass), JaxRS exceptions
99126
package problem;
100127
101128
import com.tietoevry.quarkus.resteasy.problem.HttpProblem;
102-
import javax.ws.rs.GET;
103-
import javax.ws.rs.Path;
104-
import javax.ws.rs.core.Response;
129+
import jakarta.ws.rs.GET;
130+
import jakarta.ws.rs.Path;
131+
import jakarta.ws.rs.core.Response;
105132
106133
@Path("/hello")
107134
public class HelloResource {

TROUBLESHOOTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ response property is used directly.
5151
[Quarkus issue related to this behaviour](https://github.com/quarkusio/quarkus/issues/4031)
5252

5353
## There are strange fields (stack traces etc.) in API error responses
54-
Your code most likely overrides `Jackson`/`JsonB` configuration by providing bean of type `com.fasterxml.jackson.databind.ObjectMapper`/`javax.json.bind.JsonB`, thus deregistering serializers provided by this extension - this is considered a bad practice, as described in [Quarkus docs](https://quarkus.io/guides/rest-json#configuring-json-support).
54+
Your code most likely overrides `Jackson`/`JsonB` configuration by providing bean of type `com.fasterxml.jackson.databind.ObjectMapper`/`jakarta.json.bind.JsonB`, thus deregistering serializers provided by this extension - this is considered a bad practice, as described in [Quarkus docs](https://quarkus.io/guides/rest-json#configuring-json-support).
5555
The easiest fix is to customize, not override existing configurations.
5656

5757
Jackson:
@@ -79,5 +79,5 @@ In case you really have to provide your own configuration bean, and still want t
7979

8080
```
8181
Jackson: it is very important to manually inject and apply all io.quarkus.jackson.ObjectMapperCustomizer beans in the CDI producer that produces ObjectMapper. Failure to do so will prevent Jackson specific customizations provided by various extensions from being applied.
82-
JsonB: it is very important to manually inject and apply all io.quarkus.jsonb.JsonbConfigCustomizer beans in the CDI producer that produces javax.json.bind.Jsonb. Failure to do so will prevent JSON-B specific customizations provided by various extensions from being applied.
82+
JsonB: it is very important to manually inject and apply all io.quarkus.jsonb.JsonbConfigCustomizer beans in the CDI producer that produces jakarta.json.bind.Jsonb. Failure to do so will prevent JSON-B specific customizations provided by various extensions from being applied.
8383
```

deployment/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.tietoevry.quarkus</groupId>
77
<artifactId>quarkus-resteasy-problem-parent</artifactId>
8-
<version>2.1.1-SNAPSHOT</version>
8+
<version>3.0.0-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>quarkus-resteasy-problem-deployment</artifactId>

deployment/src/main/java/com/tietoevry/quarkus/resteasy/problem/deployment/ProblemProcessor.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
import io.quarkus.resteasy.common.spi.ResteasyJaxrsProviderBuildItem;
1818
import io.quarkus.resteasy.reactive.spi.CustomExceptionMapperBuildItem;
1919
import io.quarkus.resteasy.reactive.spi.ExceptionMapperBuildItem;
20+
import jakarta.ws.rs.Priorities;
2021
import java.util.Arrays;
2122
import java.util.List;
2223
import java.util.stream.Collectors;
2324
import java.util.stream.Stream;
24-
import javax.ws.rs.Priorities;
2525
import org.slf4j.Logger;
2626
import org.slf4j.LoggerFactory;
2727

@@ -45,12 +45,12 @@ private static List<ExceptionMapperDefinition> neededExceptionMappers() {
4545
.thatHandles("com.tietoevry.quarkus.resteasy.problem.HttpProblem"),
4646

4747
mapper(EXTENSION_MAIN_PACKAGE + "jaxrs.WebApplicationExceptionMapper")
48-
.thatHandles("javax.ws.rs.WebApplicationException"),
48+
.thatHandles("jakarta.ws.rs.WebApplicationException"),
4949
mapper(EXTENSION_MAIN_PACKAGE + "jaxrs.JaxRsForbiddenExceptionMapper")
50-
.thatHandles("javax.ws.rs.ForbiddenException"),
51-
mapper(EXTENSION_MAIN_PACKAGE + "jaxrs.NotFoundExceptionMapper").thatHandles("javax.ws.rs.NotFoundException"),
50+
.thatHandles("jakarta.ws.rs.ForbiddenException"),
51+
mapper(EXTENSION_MAIN_PACKAGE + "jaxrs.NotFoundExceptionMapper").thatHandles("jakarta.ws.rs.NotFoundException"),
5252
mapper(EXTENSION_MAIN_PACKAGE + "jsonb.RestEasyClassicJsonbExceptionMapper")
53-
.thatHandles("javax.ws.rs.ProcessingException"),
53+
.thatHandles("jakarta.ws.rs.ProcessingException"),
5454

5555
mapper(EXTENSION_MAIN_PACKAGE + "security.UnauthorizedExceptionMapper")
5656
.thatHandles("io.quarkus.security.UnauthorizedException").onlyIf(new RestEasyClassicDetector()),
@@ -64,10 +64,10 @@ private static List<ExceptionMapperDefinition> neededExceptionMappers() {
6464
.thatHandles("io.quarkus.security.ForbiddenException"),
6565

6666
mapper(EXTENSION_MAIN_PACKAGE + "validation.ValidationExceptionMapper")
67-
.thatHandles("javax.validation.ValidationException"),
67+
.thatHandles("jakarta.validation.ValidationException"),
6868

6969
mapper(EXTENSION_MAIN_PACKAGE + "validation.ConstraintViolationExceptionMapper")
70-
.thatHandles("javax.validation.ConstraintViolationException"),
70+
.thatHandles("jakarta.validation.ConstraintViolationException"),
7171

7272
mapper(EXTENSION_MAIN_PACKAGE + "jackson.JsonProcessingExceptionMapper")
7373
.thatHandles("com.fasterxml.jackson.core.JsonProcessingException").onlyIf(new JacksonDetector()),
@@ -78,10 +78,10 @@ private static List<ExceptionMapperDefinition> neededExceptionMappers() {
7878
.thatHandles("com.fasterxml.jackson.databind.exc.InvalidFormatException").onlyIf(new JacksonDetector()),
7979

8080
mapper(EXTENSION_MAIN_PACKAGE + "jsonb.RestEasyClassicJsonbExceptionMapper")
81-
.thatHandles("javax.ws.rs.ProcessingException")
81+
.thatHandles("jakarta.ws.rs.ProcessingException")
8282
.onlyIf(new JsonBDetector()),
8383

84-
mapper(EXTENSION_MAIN_PACKAGE + "jsonb.JsonbExceptionMapper").thatHandles("javax.json.bind.JsonbException")
84+
mapper(EXTENSION_MAIN_PACKAGE + "jsonb.JsonbExceptionMapper").thatHandles("jakarta.json.bind.JsonbException")
8585
.onlyIf(new JsonBDetector()),
8686

8787
mapper(EXTENSION_MAIN_PACKAGE + "ZalandoProblemMapper").thatHandles("org.zalando.problem.ThrowableProblem"),

deployment/src/test/java/com/tietoevry/quarkus/resteasy/problem/devmode/TestMdcResource.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.tietoevry.quarkus.resteasy.problem.devmode;
22

3-
import javax.ws.rs.GET;
4-
import javax.ws.rs.Path;
5-
import javax.ws.rs.Produces;
6-
import javax.ws.rs.core.MediaType;
3+
import jakarta.ws.rs.GET;
4+
import jakarta.ws.rs.Path;
5+
import jakarta.ws.rs.Produces;
6+
import jakarta.ws.rs.core.MediaType;
77
import org.slf4j.MDC;
88

99
@Path("/throw-exception")

integration-test/pom.xml

Lines changed: 1 addition & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.tietoevry.quarkus</groupId>
77
<artifactId>quarkus-resteasy-problem-parent</artifactId>
8-
<version>2.1.1-SNAPSHOT</version>
8+
<version>3.0.0-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>quarkus-resteasy-problem-integration-test</artifactId>
@@ -152,111 +152,6 @@
152152
</dependencies>
153153
</profile>
154154

155-
<profile>
156-
<id>quarkus-2.0</id>
157-
<properties>
158-
<quarkus.version>2.0.3.Final</quarkus.version>
159-
</properties>
160-
</profile>
161-
162-
<profile>
163-
<id>quarkus-2.1</id>
164-
<properties>
165-
<quarkus.version>2.1.4.Final</quarkus.version>
166-
</properties>
167-
</profile>
168-
169-
<profile>
170-
<id>quarkus-2.2</id>
171-
<properties>
172-
<quarkus.version>2.2.4.Final</quarkus.version>
173-
</properties>
174-
</profile>
175-
176-
<profile>
177-
<id>quarkus-2.3</id>
178-
<properties>
179-
<quarkus.version>2.3.1.Final</quarkus.version>
180-
</properties>
181-
</profile>
182-
183-
<profile>
184-
<id>quarkus-2.4</id>
185-
<properties>
186-
<quarkus.version>2.4.2.Final</quarkus.version>
187-
</properties>
188-
</profile>
189-
190-
<profile>
191-
<id>quarkus-2.5</id>
192-
<properties>
193-
<quarkus.version>2.5.3.Final</quarkus.version>
194-
</properties>
195-
</profile>
196-
197-
<profile>
198-
<id>quarkus-2.6</id>
199-
<properties>
200-
<quarkus.version>2.6.3.Final</quarkus.version>
201-
</properties>
202-
</profile>
203-
204-
<profile>
205-
<id>quarkus-2.7</id>
206-
<properties>
207-
<quarkus.version>2.7.6.Final</quarkus.version>
208-
</properties>
209-
</profile>
210-
211-
<profile>
212-
<id>quarkus-2.8</id>
213-
<properties>
214-
<quarkus.version>2.8.3.Final</quarkus.version>
215-
</properties>
216-
</profile>
217-
218-
<profile>
219-
<id>quarkus-2.9</id>
220-
<properties>
221-
<quarkus.version>2.9.2.Final</quarkus.version>
222-
</properties>
223-
</profile>
224-
225-
<profile>
226-
<id>quarkus-2.10</id>
227-
<properties>
228-
<quarkus.version>2.10.3.Final</quarkus.version>
229-
</properties>
230-
</profile>
231-
232-
<profile>
233-
<id>quarkus-2.11</id>
234-
<properties>
235-
<quarkus.version>2.11.3.Final</quarkus.version>
236-
</properties>
237-
</profile>
238-
239-
<profile>
240-
<id>quarkus-2.12</id>
241-
<properties>
242-
<quarkus.version>2.12.3.Final</quarkus.version>
243-
</properties>
244-
</profile>
245-
246-
<profile>
247-
<id>quarkus-2.13</id>
248-
<properties>
249-
<quarkus.version>2.13.6.Final</quarkus.version>
250-
</properties>
251-
</profile>
252-
253-
<profile>
254-
<id>quarkus-2.14</id>
255-
<properties>
256-
<quarkus.version>2.14.3.Final</quarkus.version>
257-
</properties>
258-
</profile>
259-
260155
<profile>
261156
<id>native</id>
262157
<properties>

integration-test/src/main/java/com/tietoevry/quarkus/resteasy/problem/GenericExceptionsResource.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.tietoevry.quarkus.resteasy.problem;
22

3-
import javax.ws.rs.GET;
4-
import javax.ws.rs.Path;
5-
import javax.ws.rs.Produces;
6-
import javax.ws.rs.QueryParam;
7-
import javax.ws.rs.core.MediaType;
8-
import javax.ws.rs.core.Response;
3+
import jakarta.ws.rs.GET;
4+
import jakarta.ws.rs.Path;
5+
import jakarta.ws.rs.Produces;
6+
import jakarta.ws.rs.QueryParam;
7+
import jakarta.ws.rs.core.MediaType;
8+
import jakarta.ws.rs.core.Response;
99

1010
@Path("/throw/generic/")
1111
@Produces(MediaType.APPLICATION_JSON)

integration-test/src/main/java/com/tietoevry/quarkus/resteasy/problem/JaxRsExceptionsResource.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package com.tietoevry.quarkus.resteasy.problem;
22

3-
import static javax.ws.rs.core.HttpHeaders.RETRY_AFTER;
3+
import static jakarta.ws.rs.core.HttpHeaders.RETRY_AFTER;
44

55
import java.net.URI;
6-
import javax.ws.rs.ForbiddenException;
7-
import javax.ws.rs.GET;
8-
import javax.ws.rs.NotFoundException;
9-
import javax.ws.rs.Path;
10-
import javax.ws.rs.Produces;
11-
import javax.ws.rs.QueryParam;
12-
import javax.ws.rs.RedirectionException;
13-
import javax.ws.rs.WebApplicationException;
14-
import javax.ws.rs.core.MediaType;
15-
import javax.ws.rs.core.Response;
6+
import jakarta.ws.rs.ForbiddenException;
7+
import jakarta.ws.rs.GET;
8+
import jakarta.ws.rs.NotFoundException;
9+
import jakarta.ws.rs.Path;
10+
import jakarta.ws.rs.Produces;
11+
import jakarta.ws.rs.QueryParam;
12+
import jakarta.ws.rs.RedirectionException;
13+
import jakarta.ws.rs.WebApplicationException;
14+
import jakarta.ws.rs.core.MediaType;
15+
import jakarta.ws.rs.core.Response;
1616

1717
@Path("/throw/jax-rs/")
1818
@Produces(MediaType.APPLICATION_JSON)

0 commit comments

Comments
 (0)