From 48bc187925a08402f11821885b637002f8392f95 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Fri, 25 Feb 2022 21:24:41 +0000 Subject: [PATCH 1/5] Exclude everything from org.hibernate:quarkus-local-cache to avoid javax transitives --- extensions/hibernate-orm/runtime/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extensions/hibernate-orm/runtime/pom.xml b/extensions/hibernate-orm/runtime/pom.xml index 90a2778d5014a..efaaed003a84f 100644 --- a/extensions/hibernate-orm/runtime/pom.xml +++ b/extensions/hibernate-orm/runtime/pom.xml @@ -135,6 +135,12 @@ org.hibernate quarkus-local-cache + + + * + * + + .cache/impsort-maven-plugin-${impsort-maven-plugin.version} - java.,javax.,org.,com. + java.,javax.,jakarta.,org.,com. * ${format.skip} true From b5c11c7c9d2a7b75eb98bd73ebe2d672b1593603 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Wed, 23 Mar 2022 09:44:38 +0000 Subject: [PATCH 3/5] Transformation script: refactoring and little progress --- jakarta/transform.sh | 49 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/jakarta/transform.sh b/jakarta/transform.sh index fefb9444b2c20..c1aeeb9ca81fd 100755 --- a/jakarta/transform.sh +++ b/jakarta/transform.sh @@ -10,15 +10,33 @@ quarkusPath="$(pwd)" echo "Path to quarkus repo is: $quarkusPath" +BOM="$quarkusPath/bom/application/pom.xml" + # Set up jbang alias, we are using latest released transformer version jbang alias add --name transform org.eclipse.transformer:org.eclipse.transformer.cli:0.2.0 -# Arc project transformation -jbang transform "$quarkusPath/independent-projects/arc" +# Function to help transform a particular Maven module using Eclipse Transformer +transform_module () { + local modulePath="$quarkusPath/$1" + local transformationTemp="$quarkusPath/JAKARTA_TEMP" + rm -Rf $transformationTemp + mkdir $transformationTemp + echo "Transforming $modulePath" + jbang transform -o $modulePath $transformationTemp + rm -Rf "$modulePath" + mv "$transformationTemp" "$modulePath" + echo "Transformation done" +} -# Replace old sources with newly generated ones -rm -rf "$quarkusPath/independent-projects/arc" -mv "$quarkusPath/independent-projects/output_arc" "$quarkusPath/independent-projects/arc" +# Build, test and install a particular maven module (chosen by relative path) +build_module () { + local pomPath="$quarkusPath/$1/pom.xml" + ./mvnw -B clean install -f "$pomPath" + echo "Installed newly built $pomPath" +} + +# Arc project transformation +transform_module "independent-projects/arc" # Now we need to update CDI, JTA, JPA and common annotations artifacts sed -i 's/2.0.2<\/version.cdi>/3.0.0<\/version.cdi>/g' "$quarkusPath/independent-projects/arc/pom.xml" @@ -26,7 +44,24 @@ sed -i 's/1.3.3<\/version.jta>/2.0.0<\/version.jta>/g' sed -i 's/1.3.5<\/version.jakarta-annotation>/2.0.0<\/version.jakarta-annotation>/g' "$quarkusPath/independent-projects/arc/pom.xml" sed -i 's/2.2.3<\/version.jpa>/3.0.0<\/version.jpa>/g' "$quarkusPath/independent-projects/arc/pom.xml" -# Execute build and tests to verify functionality -./mvnw -B clean install -f "$quarkusPath/independent-projects/arc/pom.xml" +# Test & install modified Arc +build_module "independent-projects/arc" + +# Switch parent BOM to Jakarta artifacts + +sed -i 's/1.0<\/jakarta.inject-api.version>/2.0.0<\/jakarta.inject-api.version>/g' $BOM +sed -i 's/1.2.5<\/jakarta.interceptor-api.version>/2.0.0<\/jakarta.interceptor-api.version>/g' $BOM +sed -i 's/1.3.3<\/jakarta.transaction-api.version>/2.0.0<\/jakarta.transaction-api.version>/g' $BOM +sed -i 's/2.0.2<\/jakarta.enterprise.cdi-api.version>/3.0.0<\/jakarta.enterprise.cdi-api.version>/g' $BOM +sed -i 's/1.3.5<\/jakarta.annotation-api.version>/2.0.0<\/jakarta.annotation-api.version>/g' $BOM +sed -i 's/2.2.3<\/jakarta.persistence-api.version>/3.0.0<\/jakarta.persistence-api.version>/g' $BOM + +# Install the modified BOM: +build_module "bom/application" +## Arc Extension [Incomplete: other modules need to go first] +# transform_module "extensions/arc/runtime" +# transform_module "extensions/arc/deployment" +# build_module "extensions/arc/runtime" +# build_module "extensions/arc/deployment" From 1b18c34a7de80c1ca987edce71f113d618e2098c Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Wed, 23 Mar 2022 21:18:50 +0000 Subject: [PATCH 4/5] Jakarta script: use single-pass sed editing --- jakarta/transform.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/jakarta/transform.sh b/jakarta/transform.sh index c1aeeb9ca81fd..adf1b0aa7802a 100755 --- a/jakarta/transform.sh +++ b/jakarta/transform.sh @@ -39,22 +39,25 @@ build_module () { transform_module "independent-projects/arc" # Now we need to update CDI, JTA, JPA and common annotations artifacts -sed -i 's/2.0.2<\/version.cdi>/3.0.0<\/version.cdi>/g' "$quarkusPath/independent-projects/arc/pom.xml" -sed -i 's/1.3.3<\/version.jta>/2.0.0<\/version.jta>/g' "$quarkusPath/independent-projects/arc/pom.xml" -sed -i 's/1.3.5<\/version.jakarta-annotation>/2.0.0<\/version.jakarta-annotation>/g' "$quarkusPath/independent-projects/arc/pom.xml" -sed -i 's/2.2.3<\/version.jpa>/3.0.0<\/version.jpa>/g' "$quarkusPath/independent-projects/arc/pom.xml" +sed -e 's/2.0.2<\/version.cdi>/3.0.0<\/version.cdi>/g' \ + -e 's/1.3.3<\/version.jta>/2.0.0<\/version.jta>/g' \ + -e 's/1.3.5<\/version.jakarta-annotation>/2.0.0<\/version.jakarta-annotation>/g' \ + -e 's/2.2.3<\/version.jpa>/3.0.0<\/version.jpa>/g' \ + -i "$quarkusPath/independent-projects/arc/pom.xml" + # Test & install modified Arc build_module "independent-projects/arc" # Switch parent BOM to Jakarta artifacts -sed -i 's/1.0<\/jakarta.inject-api.version>/2.0.0<\/jakarta.inject-api.version>/g' $BOM -sed -i 's/1.2.5<\/jakarta.interceptor-api.version>/2.0.0<\/jakarta.interceptor-api.version>/g' $BOM -sed -i 's/1.3.3<\/jakarta.transaction-api.version>/2.0.0<\/jakarta.transaction-api.version>/g' $BOM -sed -i 's/2.0.2<\/jakarta.enterprise.cdi-api.version>/3.0.0<\/jakarta.enterprise.cdi-api.version>/g' $BOM -sed -i 's/1.3.5<\/jakarta.annotation-api.version>/2.0.0<\/jakarta.annotation-api.version>/g' $BOM -sed -i 's/2.2.3<\/jakarta.persistence-api.version>/3.0.0<\/jakarta.persistence-api.version>/g' $BOM +sed -e 's/1.0<\/jakarta.inject-api.version>/2.0.0<\/jakarta.inject-api.version>/g' \ + -e 's/1.2.5<\/jakarta.interceptor-api.version>/2.0.0<\/jakarta.interceptor-api.version>/g' \ + -e 's/1.3.3<\/jakarta.transaction-api.version>/2.0.0<\/jakarta.transaction-api.version>/g' \ + -e 's/2.0.2<\/jakarta.enterprise.cdi-api.version>/3.0.0<\/jakarta.enterprise.cdi-api.version>/g' \ + -e 's/1.3.5<\/jakarta.annotation-api.version>/2.0.0<\/jakarta.annotation-api.version>/g' \ + -e 's/2.2.3<\/jakarta.persistence-api.version>/3.0.0<\/jakarta.persistence-api.version>/g' \ + -i $BOM # Install the modified BOM: build_module "bom/application" From 734bde7defc21cc813c2bd77c81e6d9bd9eb4de4 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Wed, 23 Mar 2022 21:52:32 +0000 Subject: [PATCH 5/5] Make it easier to write sed scripts to change property values --- jakarta/transform.sh | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/jakarta/transform.sh b/jakarta/transform.sh index adf1b0aa7802a..6810db52bf56c 100755 --- a/jakarta/transform.sh +++ b/jakarta/transform.sh @@ -35,29 +35,42 @@ build_module () { echo "Installed newly built $pomPath" } +# Sets the EDITING variable to the file being edited by set_property +edit_begin () { + EDITING="$quarkusPath/$1" +} + +# Finds a particular property and replaces its value +set_property () { + if [ "$#" -ne 2 ]; then + echo "Requires two parameters" + fi + local propName=$1 + local propValue=$2 + sed -i "s/<$propName>.*<\/$propName>/<$propName>$propValue<\/$propName>/g" "$EDITING" +} + # Arc project transformation transform_module "independent-projects/arc" # Now we need to update CDI, JTA, JPA and common annotations artifacts -sed -e 's/2.0.2<\/version.cdi>/3.0.0<\/version.cdi>/g' \ - -e 's/1.3.3<\/version.jta>/2.0.0<\/version.jta>/g' \ - -e 's/1.3.5<\/version.jakarta-annotation>/2.0.0<\/version.jakarta-annotation>/g' \ - -e 's/2.2.3<\/version.jpa>/3.0.0<\/version.jpa>/g' \ - -i "$quarkusPath/independent-projects/arc/pom.xml" - +edit_begin "independent-projects/arc/pom.xml" +set_property "version.cdi" "3.0.0" +set_property "version.jta" "2.0.0" +set_property "version.jakarta-annotation" "2.0.0" +set_property "version.jpa" "3.0.0" # Test & install modified Arc build_module "independent-projects/arc" # Switch parent BOM to Jakarta artifacts - -sed -e 's/1.0<\/jakarta.inject-api.version>/2.0.0<\/jakarta.inject-api.version>/g' \ - -e 's/1.2.5<\/jakarta.interceptor-api.version>/2.0.0<\/jakarta.interceptor-api.version>/g' \ - -e 's/1.3.3<\/jakarta.transaction-api.version>/2.0.0<\/jakarta.transaction-api.version>/g' \ - -e 's/2.0.2<\/jakarta.enterprise.cdi-api.version>/3.0.0<\/jakarta.enterprise.cdi-api.version>/g' \ - -e 's/1.3.5<\/jakarta.annotation-api.version>/2.0.0<\/jakarta.annotation-api.version>/g' \ - -e 's/2.2.3<\/jakarta.persistence-api.version>/3.0.0<\/jakarta.persistence-api.version>/g' \ - -i $BOM +edit_begin "bom/application/pom.xml" +set_property "jakarta.inject-api.version" "2.0.0" +set_property "jakarta.interceptor-api.version" "2.0.0" +set_property "jakarta.transaction-api.version" "2.0.0" +set_property "jakarta.enterprise.cdi-api.version" "3.0.0" +set_property "jakarta.annotation-api.version" "2.0.0" +set_property "jakarta.persistence-api.version" "3.0.0" # Install the modified BOM: build_module "bom/application"