From d7d9bde415d9e7266f2acc2ba628df185850bd62 Mon Sep 17 00:00:00 2001 From: m-brophy Date: Thu, 24 Aug 2023 12:06:00 +0100 Subject: [PATCH 1/4] kitchesink quarkus migration rules --- .../eap8/eap7/hibernate-6.2.windup.xml | 1 + .../eap8/eap7/hibernate-search-6.1.windup.xml | 1 + .../eap8/eap7/hibernate-search.windup.xml | 1 + .../eap8/eap7/hibernate6.windup.xml | 1 + .../quarkus/java-ee/cdi-to-quarkus.windup.xml | 29 +++++++++ .../dependency-removal-for-quarkus.windup.xml | 35 +++++++++++ .../javaee-faces-to-quarkus.windup.xml | 60 +++++++++++++++++++ .../java-ee/javaee-pom-to-quarkus.windup.xml | 37 ++++++++++++ 8 files changed, 165 insertions(+) create mode 100644 rules/rules-reviewed/quarkus/java-ee/dependency-removal-for-quarkus.windup.xml create mode 100644 rules/rules-reviewed/quarkus/java-ee/javaee-faces-to-quarkus.windup.xml diff --git a/rules/rules-reviewed/eap8/eap7/hibernate-6.2.windup.xml b/rules/rules-reviewed/eap8/eap7/hibernate-6.2.windup.xml index 8c873077b..a36ec59ec 100644 --- a/rules/rules-reviewed/eap8/eap7/hibernate-6.2.windup.xml +++ b/rules/rules-reviewed/eap8/eap7/hibernate-6.2.windup.xml @@ -12,6 +12,7 @@ + hibernate diff --git a/rules/rules-reviewed/eap8/eap7/hibernate-search-6.1.windup.xml b/rules/rules-reviewed/eap8/eap7/hibernate-search-6.1.windup.xml index c317af34e..3f65d223b 100644 --- a/rules/rules-reviewed/eap8/eap7/hibernate-search-6.1.windup.xml +++ b/rules/rules-reviewed/eap8/eap7/hibernate-search-6.1.windup.xml @@ -12,6 +12,7 @@ + hibernate eap8 diff --git a/rules/rules-reviewed/eap8/eap7/hibernate-search.windup.xml b/rules/rules-reviewed/eap8/eap7/hibernate-search.windup.xml index b80cae175..460c6c310 100644 --- a/rules/rules-reviewed/eap8/eap7/hibernate-search.windup.xml +++ b/rules/rules-reviewed/eap8/eap7/hibernate-search.windup.xml @@ -12,6 +12,7 @@ + hibernate eap8 diff --git a/rules/rules-reviewed/eap8/eap7/hibernate6.windup.xml b/rules/rules-reviewed/eap8/eap7/hibernate6.windup.xml index 790966cd4..5df13f249 100644 --- a/rules/rules-reviewed/eap8/eap7/hibernate6.windup.xml +++ b/rules/rules-reviewed/eap8/eap7/hibernate6.windup.xml @@ -12,6 +12,7 @@ + hibernate diff --git a/rules/rules-reviewed/quarkus/java-ee/cdi-to-quarkus.windup.xml b/rules/rules-reviewed/quarkus/java-ee/cdi-to-quarkus.windup.xml index 3c7f58a19..546583506 100644 --- a/rules/rules-reviewed/quarkus/java-ee/cdi-to-quarkus.windup.xml +++ b/rules/rules-reviewed/quarkus/java-ee/cdi-to-quarkus.windup.xml @@ -64,5 +64,34 @@ + + + + ANNOTATION + + + + + In Quarkus, you can skip the @Produces annotation completely if the producer method is annotated with a scope annotation, a stereotype or a qualifier.. + This field could be accessed using a `@Named` getter method instead. + + + + + + + + + ANNOTATION + + + + + Stateless EJBs can be converted to a cdi bean by replacing the `@Stateless` annotation with a scope eg `@ApplicationScoped` + + + + + diff --git a/rules/rules-reviewed/quarkus/java-ee/dependency-removal-for-quarkus.windup.xml b/rules/rules-reviewed/quarkus/java-ee/dependency-removal-for-quarkus.windup.xml new file mode 100644 index 000000000..37abccd95 --- /dev/null +++ b/rules/rules-reviewed/quarkus/java-ee/dependency-removal-for-quarkus.windup.xml @@ -0,0 +1,35 @@ + + + + + This ruleset gives hints to migrate JAX-RS applications to Quarkus extension + + + + + + + + + + + + + + + + + + + + + + Non-quarkus dependencies are no longer required and can be removed. + + + + + + + diff --git a/rules/rules-reviewed/quarkus/java-ee/javaee-faces-to-quarkus.windup.xml b/rules/rules-reviewed/quarkus/java-ee/javaee-faces-to-quarkus.windup.xml new file mode 100644 index 000000000..18cc3cd45 --- /dev/null +++ b/rules/rules-reviewed/quarkus/java-ee/javaee-faces-to-quarkus.windup.xml @@ -0,0 +1,60 @@ + + + +]> + + + + This ruleset gives hints to migrate JAX-RS applications to Quarkus extension + + + + + + + + + + + + + + + + + + + + + + org.apache.myfaces.core.extensions.quarkus + myfaces-quarkus + 4.0.1 + + + + + io.quarkiverse.primefaces + quarkus-primefaces + 3.13.1 + + + io.quarkiverse.omnifaces + quarkus-omnifaces + 4.2.0 + + ``` + ]]> + + + + + + + diff --git a/rules/rules-reviewed/quarkus/java-ee/javaee-pom-to-quarkus.windup.xml b/rules/rules-reviewed/quarkus/java-ee/javaee-pom-to-quarkus.windup.xml index d26eef013..8c763233b 100644 --- a/rules/rules-reviewed/quarkus/java-ee/javaee-pom-to-quarkus.windup.xml +++ b/rules/rules-reviewed/quarkus/java-ee/javaee-pom-to-quarkus.windup.xml @@ -278,5 +278,42 @@ + + + + + + + + + + + + + + + + + io.quarkus + quarkus-hibernate-orm + + + + + io.quarkus + quarkus-jdbc-postgresql + + ``` + ]]> + + + + + From 809fd5eeb08f4ad1acf11c2b61e5a162e984d498 Mon Sep 17 00:00:00 2001 From: m-brophy Date: Thu, 24 Aug 2023 18:38:54 +0100 Subject: [PATCH 2/4] kitchensink migration rules tests --- .../tests/cdi-to-quarkus.windup.test.xml | 24 +++++++++++++++ .../src/main/java/sample/HelloEJB.java | 12 ++++++++ .../src/main/java/sample/HelloService.java | 3 +- .../tests/data/helloworld-rs-migrated/pom.xml | 30 +++++++++++++++++++ ...ndency-removal-for-quarkus.windup.test.xml | 24 +++++++++++++++ .../javaee-faces-to-quarkus.windup.test.xml | 24 +++++++++++++++ .../javaee-pom-to-quarkus.windup.test.xml | 12 ++++++++ 7 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 rules/rules-reviewed/quarkus/java-ee/tests/data/application-javaee-api/src/main/java/sample/HelloEJB.java create mode 100644 rules/rules-reviewed/quarkus/java-ee/tests/dependency-removal-for-quarkus.windup.test.xml create mode 100644 rules/rules-reviewed/quarkus/java-ee/tests/javaee-faces-to-quarkus.windup.test.xml diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/cdi-to-quarkus.windup.test.xml b/rules/rules-reviewed/quarkus/java-ee/tests/cdi-to-quarkus.windup.test.xml index 969a54478..25f735022 100644 --- a/rules/rules-reviewed/quarkus/java-ee/tests/cdi-to-quarkus.windup.test.xml +++ b/rules/rules-reviewed/quarkus/java-ee/tests/cdi-to-quarkus.windup.test.xml @@ -80,6 +80,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/application-javaee-api/src/main/java/sample/HelloEJB.java b/rules/rules-reviewed/quarkus/java-ee/tests/data/application-javaee-api/src/main/java/sample/HelloEJB.java new file mode 100644 index 000000000..d990fcd31 --- /dev/null +++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/application-javaee-api/src/main/java/sample/HelloEJB.java @@ -0,0 +1,12 @@ +package sample; + +import javax.ejb.Stateless; + +@Stateless +public class HelloEJB { + + String createHelloMessage(String name) { + return "Hello " + name + "!"; + } + +} \ No newline at end of file diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/application-javaee-api/src/main/java/sample/HelloService.java b/rules/rules-reviewed/quarkus/java-ee/tests/data/application-javaee-api/src/main/java/sample/HelloService.java index ea632b816..85e935d1d 100644 --- a/rules/rules-reviewed/quarkus/java-ee/tests/data/application-javaee-api/src/main/java/sample/HelloService.java +++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/application-javaee-api/src/main/java/sample/HelloService.java @@ -1,10 +1,11 @@ package sample; import javax.enterprise.context.Dependent; +import javax.enterprise.inject.Produces; @Dependent public class HelloService { - + @Produces String createHelloMessage(String name) { return "Hello " + name + "!"; } diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/helloworld-rs-migrated/pom.xml b/rules/rules-reviewed/quarkus/java-ee/tests/data/helloworld-rs-migrated/pom.xml index f60dd1a94..00981bdc5 100644 --- a/rules/rules-reviewed/quarkus/java-ee/tests/data/helloworld-rs-migrated/pom.xml +++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/helloworld-rs-migrated/pom.xml @@ -78,6 +78,36 @@ provided + + jakarta.persistence + jakarta.persistence-api + provided + + + + org.hibernate + hibernate-jpamodelgen + provided + + + + org.jboss.spec.javax.xml.bind + jboss-jaxb-api_2.3_spec + provided + + + + org.jboss.spec.javax.ejb + jboss-ejb-api_3.2_spec + provided + + + + org.jboss.spec.javax.faces + jboss-jsf-api_2.3_spec + provided + + io.quarkus quarkus-resteasy-reactive diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/dependency-removal-for-quarkus.windup.test.xml b/rules/rules-reviewed/quarkus/java-ee/tests/dependency-removal-for-quarkus.windup.test.xml new file mode 100644 index 000000000..820e5d10a --- /dev/null +++ b/rules/rules-reviewed/quarkus/java-ee/tests/dependency-removal-for-quarkus.windup.test.xml @@ -0,0 +1,24 @@ + + + data/* + ../dependency-removal-for-quarkus.windup.xml + + + + + + + + + + + + + + + + + diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/javaee-faces-to-quarkus.windup.test.xml b/rules/rules-reviewed/quarkus/java-ee/tests/javaee-faces-to-quarkus.windup.test.xml new file mode 100644 index 000000000..78f23c83b --- /dev/null +++ b/rules/rules-reviewed/quarkus/java-ee/tests/javaee-faces-to-quarkus.windup.test.xml @@ -0,0 +1,24 @@ + + + data/* + ../javaee-faces-to-quarkus.windup.xml + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/javaee-pom-to-quarkus.windup.test.xml b/rules/rules-reviewed/quarkus/java-ee/tests/javaee-pom-to-quarkus.windup.test.xml index 15a32fc6b..0b261338b 100644 --- a/rules/rules-reviewed/quarkus/java-ee/tests/javaee-pom-to-quarkus.windup.test.xml +++ b/rules/rules-reviewed/quarkus/java-ee/tests/javaee-pom-to-quarkus.windup.test.xml @@ -91,6 +91,18 @@ + + + + + + + + + + + + From 7cb27f3ab9661a33372e02c1210b9d229e45f640 Mon Sep 17 00:00:00 2001 From: m-brophy Date: Mon, 9 Oct 2023 14:50:44 +0100 Subject: [PATCH 3/4] add rule for junit --- .../java-ee/javaee-pom-to-quarkus.windup.xml | 27 +++++++++++++++++++ .../data/packaging/without-packaging/pom.xml | 5 ++++ .../javaee-pom-to-quarkus.windup.test.xml | 12 +++++++++ 3 files changed, 44 insertions(+) diff --git a/rules/rules-reviewed/quarkus/java-ee/javaee-pom-to-quarkus.windup.xml b/rules/rules-reviewed/quarkus/java-ee/javaee-pom-to-quarkus.windup.xml index 8c763233b..149a5a286 100644 --- a/rules/rules-reviewed/quarkus/java-ee/javaee-pom-to-quarkus.windup.xml +++ b/rules/rules-reviewed/quarkus/java-ee/javaee-pom-to-quarkus.windup.xml @@ -315,5 +315,32 @@ + + + + + + + + + + + + io.quarkus + quarkus-junit5 + test + + ``` + ]]> + + + + + + diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/packaging/without-packaging/pom.xml b/rules/rules-reviewed/quarkus/java-ee/tests/data/packaging/without-packaging/pom.xml index b9b2a56ea..7808666db 100644 --- a/rules/rules-reviewed/quarkus/java-ee/tests/data/packaging/without-packaging/pom.xml +++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/packaging/without-packaging/pom.xml @@ -14,6 +14,11 @@ javax.inject 1 + + junit + junit + test + diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/javaee-pom-to-quarkus.windup.test.xml b/rules/rules-reviewed/quarkus/java-ee/tests/javaee-pom-to-quarkus.windup.test.xml index 0b261338b..ab377604b 100644 --- a/rules/rules-reviewed/quarkus/java-ee/tests/javaee-pom-to-quarkus.windup.test.xml +++ b/rules/rules-reviewed/quarkus/java-ee/tests/javaee-pom-to-quarkus.windup.test.xml @@ -103,6 +103,18 @@ + + + + + + + + + + + + From 522fd833d8ab3b441969fefe6f1ff8473fc1cfc0 Mon Sep 17 00:00:00 2001 From: m-brophy Date: Tue, 10 Oct 2023 13:53:35 +0100 Subject: [PATCH 4/4] jax-rs activation rule --- .../java-ee/jaxrs-to-quarkus.windup.xml | 20 +++++++++++++++++++ .../tests/jaxrs-to-quarkus.windup.test.xml | 12 +++++++++++ 2 files changed, 32 insertions(+) diff --git a/rules/rules-reviewed/quarkus/java-ee/jaxrs-to-quarkus.windup.xml b/rules/rules-reviewed/quarkus/java-ee/jaxrs-to-quarkus.windup.xml index 6a49ebfaf..2b28d04ad 100644 --- a/rules/rules-reviewed/quarkus/java-ee/jaxrs-to-quarkus.windup.xml +++ b/rules/rules-reviewed/quarkus/java-ee/jaxrs-to-quarkus.windup.xml @@ -40,5 +40,25 @@ + + + + + ANNOTATION + + + INHERITANCE + + + + + + + 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/jaxrs-to-quarkus.windup.test.xml b/rules/rules-reviewed/quarkus/java-ee/tests/jaxrs-to-quarkus.windup.test.xml index 1a2a524f4..dc0944606 100644 --- a/rules/rules-reviewed/quarkus/java-ee/tests/jaxrs-to-quarkus.windup.test.xml +++ b/rules/rules-reviewed/quarkus/java-ee/tests/jaxrs-to-quarkus.windup.test.xml @@ -31,6 +31,18 @@ + + + + + + + + + + + +