Skip to content

Commit

Permalink
Jakarta migration: more progress
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Apr 13, 2022
1 parent 320a479 commit c55cc92
Show file tree
Hide file tree
Showing 9 changed files with 245 additions and 6 deletions.
26 changes: 26 additions & 0 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1226,5 +1226,31 @@
</properties>
</profile>

<profile>
<id>jakarta-rewrite</id>
<activation>
<property>
<name>jakarta-rewrite</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>4.21.0-SNAPSHOT</version>
<configuration>
<configLocation>${maven.multiModuleProjectDirectory}/jakarta/rewrite.yml</configLocation>
<activeStyles>
<style>io.quarkus.style.maven</style>
</activeStyles>
<activeRecipes>
<recipe>io.quarkus.build-parent</recipe>
</activeRecipes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
28 changes: 28 additions & 0 deletions extensions/hibernate-envers/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
</exclusion>

<!-- Following dependencies are only necessary during metadata initialization -->
<exclusion>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>javax.activation-api</artifactId>
Expand Down Expand Up @@ -77,4 +81,28 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jakarta-rewrite</id>
<activation>
<property>
<name>jakarta-rewrite</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<configuration>
<activeRecipes>
<recipe>io.quarkus.hibernate-orm-narayana-switch</recipe>
</activeRecipes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
23 changes: 23 additions & 0 deletions extensions/kubernetes-client/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,28 @@
</plugins>
</build>

<profiles>
<profile>
<id>jakarta-rewrite</id>
<activation>
<property>
<name>jakarta-rewrite</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<configuration>
<activeRecipes>
<recipe>io.quarkus.jakarta-jaxb-switch</recipe>
</activeRecipes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
24 changes: 24 additions & 0 deletions extensions/security-webauthn/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,28 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jakarta-rewrite</id>
<activation>
<property>
<name>jakarta-rewrite</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<configuration>
<activeRecipes>
<recipe>io.quarkus.jakarta-jaxrs-switch</recipe>
</activeRecipes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
24 changes: 24 additions & 0 deletions extensions/smallrye-opentracing/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,28 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jakarta-rewrite</id>
<activation>
<property>
<name>jakarta-rewrite</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<configuration>
<activeRecipes>
<recipe>io.quarkus.jakarta-jaxrs-switch</recipe>
</activeRecipes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
25 changes: 21 additions & 4 deletions jakarta/rewrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ recipeList:
oldGroupId: org.hibernate
oldArtifactId: hibernate-envers
newGroupId: org.hibernate
newArtifactId: hibernate-envers-jakarta
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-jpamodelgen
Expand Down Expand Up @@ -208,6 +209,14 @@ recipeList:
artifactId: jakarta.xml.bind-api
---
type: specs.openrewrite.org/v1beta/recipe
name: io.quarkus.build-parent
displayName: Adjust build-parent
recipeList:
- org.openrewrite.maven.ChangePropertyValue:
key: subethasmtp.version
newValue: 6.0.1
---
type: specs.openrewrite.org/v1beta/recipe
name: io.quarkus.jakarta-security
displayName: Adjust Javax security dependencies
recipeList:
Expand Down Expand Up @@ -368,6 +377,12 @@ recipeList:
- org.openrewrite.maven.ChangePropertyValue:
key: smallrye-health.version
newValue: 4.0.0-RC2
- org.openrewrite.maven.ChangePropertyValue:
key: microprofile-jwt.version
newValue: 2.0
- org.openrewrite.maven.ChangePropertyValue:
key: smallrye-jwt.version
newValue: 4.0.0-RC1
- org.openrewrite.maven.ChangePropertyValue:
key: microprofile-metrics-api.version
newValue: 4.0.1
Expand All @@ -377,17 +392,19 @@ recipeList:
- org.openrewrite.maven.ChangePropertyValue:
key: smallrye-open-api.version
newValue: 3.0.0-RC1
- org.openrewrite.maven.ChangePropertyValue:
key: microprofile-opentracing-api.version
newValue: 3.0
- org.openrewrite.maven.ChangePropertyValue:
key: smallrye-opentracing.version
newValue: 3.0.0-RC1
- org.openrewrite.maven.ChangePropertyValue:
key: microprofile-rest-client.version
newValue: 3.0
# In progress, these ones need a change:
# <microprofile-opentracing-api.version>2.0</microprofile-opentracing-api.version>
# <microprofile-reactive-streams-operators.version>1.0.1</microprofile-reactive-streams-operators.version>
# <microprofile-jwt.version>1.2</microprofile-jwt.version>
# <microprofile-lra.version>1.0</microprofile-lra.version>
# <smallrye-graphql.version>1.4.3</smallrye-graphql.version>
# <smallrye-opentracing.version>2.1.0</smallrye-opentracing.version>
# <smallrye-jwt.version>3.3.3</smallrye-jwt.version>
# <smallrye-reactive-streams-operators.version>1.0.13</smallrye-reactive-streams-operators.version>
# <smallrye-reactive-types-converter.version>2.6.0</smallrye-reactive-types-converter.version>
# <smallrye-mutiny-vertx-binding.version>2.19.0</smallrye-mutiny-vertx-binding.version>
Expand Down
53 changes: 51 additions & 2 deletions jakarta/transform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ clean_project
./mvnw -B -pl :quarkus-platform-descriptor-json-plugin -pl :quarkus-bootstrap-maven-plugin -pl :quarkus-enforcer-rules -am clean install -DskipTests -DskipITs -Dinvoker.skip

## we cannot rewrite some of the modules for various reasons but we rewrite most of them
./mvnw -B -e rewrite:run -Denforcer.skip -Dprotoc.skip -Dmaven.main.skip -Dmaven.test.skip -Dforbiddenapis.skip -Dinvoker.skip -pl '!:quarkus-bom-quarkus-platform-descriptor' -pl '!:io.quarkus.gradle.plugin' -pl '!:io.quarkus.extension.gradle.plugin' -pl '!:quarkus-cli' -pl '!:quarkus-documentation' -Dno-test-modules -Drewrite.pomCacheEnabled=false -Djakarta-rewrite
./mvnw -B -e rewrite:run -Denforcer.skip -Dprotoc.skip -Dmaven.main.skip -Dmaven.test.skip -Dforbiddenapis.skip -Dinvoker.skip -pl '!:quarkus-bom-quarkus-platform-descriptor' -pl '!:io.quarkus.gradle.plugin' -pl '!:io.quarkus.extension.gradle.plugin' -pl '!:quarkus-cli' -pl '!:quarkus-documentation' -pl '!:quarkus-integration-tests-parent' -Dno-test-modules -Drewrite.pomCacheEnabled=false -Djakarta-rewrite

## remove banned dependencies
remove_banned_dependency "independent-projects/bootstrap" 'javax.inject:javax.inject' 'we allow javax.inject for Maven'
Expand Down Expand Up @@ -362,7 +362,6 @@ build_module "extensions/smallrye-openapi-common"
build_module "extensions/swagger-ui"
build_module "extensions/smallrye-openapi"
build_module "extensions/smallrye-health"
# TODO: tests are not passing for now, I pinged Jan
build_module "extensions/smallrye-metrics"

# Persistence
Expand Down Expand Up @@ -399,12 +398,62 @@ build_module "extensions/reactive-pg-client"
build_module "test-framework/vertx"
build_module "extensions/hibernate-reactive"

# And now in alphabetical order (dependency aside)...
# TODO apicurio-registry-avro depends on old JAX-RS spec
build_module "extensions/awt"
build_module "extensions/azure-functions-http"
build_module "extensions/cache"
build_module "extensions/config-yaml"
build_module "extensions/kubernetes-client"
build_module "extensions/container-image"
build_module "extensions/elytron-security-jdbc"
build_module "test-framework/ldap"
build_module "extensions/elytron-security-ldap"
build_module "extensions/elytron-security-oauth2"
build_module "extensions/flyway"
build_module "extensions/funqy"
build_module "extensions/google-cloud-functions"
build_module "extensions/google-cloud-functions-http"
build_module "extensions/grpc-common"
build_module "extensions/grpc"
build_module "extensions/hibernate-envers"
build_module "extensions/infinispan-client"
build_module "extensions/jaeger"
build_module "extensions/kafka-client"
build_module "test-framework/junit5-mockito-config"
build_module "test-framework/junit5-mockito"
build_module "extensions/kafka-streams"
build_module "test-framework/keycloak-server"
# TODO we need a keycloak-admin-client-jakarta
#build_module "extensions/keycloak-admin-client"
#build_module "extensions/keycloak-admin-client-reactive"
build_module "extensions/smallrye-jwt-build"
build_module "extensions/oidc-common"
build_module "extensions/oidc"
# TODO we need the quarkus-keycloak-admin-client extension
#build_module "extensions/keycloak-authorization"
build_module "extensions/kubernetes"
build_module "extensions/kubernetes-config"
build_module "extensions/liquibase"
build_module "extensions/reactive-streams-operators"
build_module "extensions/smallrye-opentracing"
build_module "extensions/mongodb-client"
build_module "extensions/liquibase-mongodb"
build_module "extensions/logging-gelf"
build_module "extensions/logging-json"
build_module "extensions/mailer"
build_module "extensions/micrometer"
build_module "extensions/micrometer-registry-prometheus"
# TODO we need a narayana-lra Jakarta extension (dependency of MP spec and CDI spec)
#build_module "extensions/narayana-lra"

exit 0

# These ones require ArC and Mutiny extensions
#build_module "test-framework/junit5-mockito-config"
#build_module "test-framework/junit5-mockito"


# Dev Tools - needs to be done after all the extensions have been built and before we run the ITs
#transform_module "devtools"
#build_module_no_tests "devtools"
Expand Down
24 changes: 24 additions & 0 deletions test-framework/kubernetes-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,28 @@
</dependency>
</dependencies>

<profiles>
<profile>
<id>jakarta-rewrite</id>
<activation>
<property>
<name>jakarta-rewrite</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<configuration>
<activeRecipes>
<recipe>io.quarkus.jakarta-jaxrs-switch</recipe>
</activeRecipes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
24 changes: 24 additions & 0 deletions test-framework/openshift-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,28 @@
</dependency>
</dependencies>

<profiles>
<profile>
<id>jakarta-rewrite</id>
<activation>
<property>
<name>jakarta-rewrite</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<configuration>
<activeRecipes>
<recipe>io.quarkus.jakarta-jaxrs-switch</recipe>
</activeRecipes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>

0 comments on commit c55cc92

Please sign in to comment.