From 8dfaa1eed6ecd35594ece97752af9f8f0ac6fc83 Mon Sep 17 00:00:00 2001 From: BoykoAlex Date: Mon, 16 May 2022 18:01:55 -0400 Subject: [PATCH] Missing declarative recipes --- .../rewrite/spring-boot3-config-upgrade.yml | 31 +++++++++++++++++++ .../META-INF/rewrite/spring-boot3-upgrade.yml | 26 ++++++++++++++++ .../META-INF/rewrite/spring-data3-upgrade.yml | 24 ++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 headless-services/commons/commons-rewrite/src/main/resources/META-INF/rewrite/spring-boot3-config-upgrade.yml create mode 100644 headless-services/commons/commons-rewrite/src/main/resources/META-INF/rewrite/spring-boot3-upgrade.yml create mode 100644 headless-services/commons/commons-rewrite/src/main/resources/META-INF/rewrite/spring-data3-upgrade.yml diff --git a/headless-services/commons/commons-rewrite/src/main/resources/META-INF/rewrite/spring-boot3-config-upgrade.yml b/headless-services/commons/commons-rewrite/src/main/resources/META-INF/rewrite/spring-boot3-config-upgrade.yml new file mode 100644 index 000000000..f954384ed --- /dev/null +++ b/headless-services/commons/commons-rewrite/src/main/resources/META-INF/rewrite/spring-boot3-config-upgrade.yml @@ -0,0 +1,31 @@ +# +# Copyright 2021 the original author or authors. +#

+# 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 +#

+# https://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. +# +# --- +type: specs.openrewrite.org/v1beta/recipe +name: org.openrewrite.java.spring.boot2.SpringBootProperties_3_0 +displayName: Migrate Spring Boot properties to 3.0 +description: Migrate properties found in `application.properties` and `application.yml`. +recipeList: + - org.openrewrite.properties.ChangePropertyKey: + oldPropertyKey: spring.datasource.initialization-mode + newPropertyKey: spring.sql.init.mode + - org.openrewrite.yaml.ChangePropertyKey: + oldPropertyKey: spring.datasource.schema + newPropertyKey: spring.sql.init.schema-locations + - org.openrewrite.yaml.ChangePropertyKey: + oldPropertyKey: spring.datasource.data + newPropertyKey: spring.sql.init.data-locations + \ No newline at end of file diff --git a/headless-services/commons/commons-rewrite/src/main/resources/META-INF/rewrite/spring-boot3-upgrade.yml b/headless-services/commons/commons-rewrite/src/main/resources/META-INF/rewrite/spring-boot3-upgrade.yml new file mode 100644 index 000000000..7ea3e0682 --- /dev/null +++ b/headless-services/commons/commons-rewrite/src/main/resources/META-INF/rewrite/spring-boot3-upgrade.yml @@ -0,0 +1,26 @@ +--- +######################################################################################################################## +# SpringBoot 3_0 +type: specs.openrewrite.org/v1beta/recipe +name: org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0 +displayName: Upgrade to Spring Boot 3.0 from 2.x +description: 'Upgrade to Spring Boot 3.0 from prior 2.x version.' +recipeList: + # Upgrade 3.0.x from 2.x + - org.openrewrite.maven.UpgradeDependencyVersion: + groupId: org.springframework.boot + artifactId: "*" + newVersion: 3.0.0-SNAPSHOT + trustParent: true + - org.openrewrite.maven.UpgradeParentVersion: + groupId: org.springframework.boot + artifactId: spring-boot-starter-parent + newVersion: 3.0.0-SNAPSHOT + - org.openrewrite.maven.ChangePropertyValue: + key: 'java.version' + newValue: 17 + addIfMissing: true + + - org.openrewrite.java.spring.data.UpgradeSpringData_3_0 + - org.openrewrite.java.spring.boot2.SpringBootProperties_3_0 + \ No newline at end of file diff --git a/headless-services/commons/commons-rewrite/src/main/resources/META-INF/rewrite/spring-data3-upgrade.yml b/headless-services/commons/commons-rewrite/src/main/resources/META-INF/rewrite/spring-data3-upgrade.yml new file mode 100644 index 000000000..b4153ba45 --- /dev/null +++ b/headless-services/commons/commons-rewrite/src/main/resources/META-INF/rewrite/spring-data3-upgrade.yml @@ -0,0 +1,24 @@ +######################################################################################################################## +# Spring Data 3.0 +type: specs.openrewrite.org/v1beta/recipe +name: org.openrewrite.java.spring.data.UpgradeSpringData_3_0 +displayName: Upgrade to Spring Data 3.0 +description: 'Upgrade to Spring Data to 3.0 from any prior version.' +recipeList: + - org.springframework.ide.vscode.commons.rewrite.maven.ChangeDependencyClassifier: + groupId: org.ehcache + artifactId: ehcache + newClassifier: jakarta + - org.openrewrite.java.ChangePackage: + oldPackageName: javax.persistence + newPackageName: jakarta.persistence + recursive: true + - org.openrewrite.java.ChangePackage: + oldPackageName: javax.validation + newPackageName: jakarta.validation + recursive: true + - org.openrewrite.java.ChangePackage: + oldPackageName: javax.xml.bind + newPackageName: jakarta.xml.bind + recursive: true + \ No newline at end of file