From 8d5aa62eebe27846c5500e301ec27b87559d4819 Mon Sep 17 00:00:00 2001 From: Mark Brophy <36955467+m-brophy@users.noreply.github.com> Date: Wed, 17 Jan 2024 14:26:55 +0000 Subject: [PATCH] WINDUPRULE-1041 jakarta jaxrs to quarkus rules (#1058) --- .../jakarta-jaxrs-to-quarkus.windup.xml | 51 +++++++++++++++++++ .../data/application-jakarta-api/pom.xml | 5 ++ .../src/main/java/sample/JAXActivator.java | 30 +++++++++++ .../jakarta-jaxrs-to-quarkus.windup.test.xml | 36 +++++++++++++ 4 files changed, 122 insertions(+) create mode 100644 rules/rules-reviewed/quarkus/java-ee/jakarta-jaxrs-to-quarkus.windup.xml create mode 100644 rules/rules-reviewed/quarkus/java-ee/tests/data/application-jakarta-api/src/main/java/sample/JAXActivator.java create mode 100644 rules/rules-reviewed/quarkus/java-ee/tests/jakarta-jaxrs-to-quarkus.windup.test.xml diff --git a/rules/rules-reviewed/quarkus/java-ee/jakarta-jaxrs-to-quarkus.windup.xml b/rules/rules-reviewed/quarkus/java-ee/jakarta-jaxrs-to-quarkus.windup.xml new file mode 100644 index 000000000..b7c8c99a5 --- /dev/null +++ b/rules/rules-reviewed/quarkus/java-ee/jakarta-jaxrs-to-quarkus.windup.xml @@ -0,0 +1,51 @@ + + + + + This ruleset gives hints to migrate JAX-RS applications to Quarkus extension + + + + + + + + + + + + + + + + + + Dependency `jakarta.ws.rs:jakarta.ws.rs-api` has to be replaced with `io.quarkus:quarkus-resteasy-reactive` artifact. + + + + + + + + + + ANNOTATION + + + INHERITANCE + + + + + + + Jakarta JAX-RS activation is no longer necessary. You can set a root path like this but you don't have to. + + + + + + + diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/application-jakarta-api/pom.xml b/rules/rules-reviewed/quarkus/java-ee/tests/data/application-jakarta-api/pom.xml index 91e1d91aa..9e609912c 100644 --- a/rules/rules-reviewed/quarkus/java-ee/tests/data/application-jakarta-api/pom.xml +++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/application-jakarta-api/pom.xml @@ -49,6 +49,11 @@ 9.0.0 provided + + jakarta.ws.rs + jakarta.ws.rs-api + 3.1.0 + jakarta.faces jakarta.faces-api diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/application-jakarta-api/src/main/java/sample/JAXActivator.java b/rules/rules-reviewed/quarkus/java-ee/tests/data/application-jakarta-api/src/main/java/sample/JAXActivator.java new file mode 100644 index 000000000..73369b935 --- /dev/null +++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/application-jakarta-api/src/main/java/sample/JAXActivator.java @@ -0,0 +1,30 @@ +/** + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jakarta.quickstarts.rshelloworld; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +/** + * JAXActivator is an arbitrary name, what is important is that jakarta.ws.rs.core.Application is extended + * and the @ApplicationPath annotation is used with a "rest" path. Without this the rest routes linked to + * from index.html would not be found. + */ +@ApplicationPath("rest") +public class JAXActivator extends Application { + // Left empty intentionally +} diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/jakarta-jaxrs-to-quarkus.windup.test.xml b/rules/rules-reviewed/quarkus/java-ee/tests/jakarta-jaxrs-to-quarkus.windup.test.xml new file mode 100644 index 000000000..8ea7f7be2 --- /dev/null +++ b/rules/rules-reviewed/quarkus/java-ee/tests/jakarta-jaxrs-to-quarkus.windup.test.xml @@ -0,0 +1,36 @@ + + + data/application-jakarta-api/* + ../jakarta-jaxrs-to-quarkus.windup.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + +