From 44bc91a6e6b72ebe225fd104173e38f81fde713c Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Fri, 7 Nov 2025 14:16:43 +0100 Subject: [PATCH 1/3] add section for CAP Java OpenRewrite recipes --- java/migration.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/java/migration.md b/java/migration.md index 1697c152b1..9fdc2f4218 100644 --- a/java/migration.md +++ b/java/migration.md @@ -1414,3 +1414,24 @@ After rebuilding and restarting your application, your Application Services are + +## Automatic Java Migrations with Open Rewrite { #open-rewrite } + +Whenever we introduce new versions or replacements of an API version we try make the transition from the old version to the new version as smooth as possible. When possible we introduce a new version in the same major version as the version where deprecate the old version. This is the foundation for having automatic code migrations with [OpenRewrite](https://docs.openrewrite.org). At CAP Java, we aim to provide Open Rewrite Recipes for our API changes. + +The application of these recipes is done via Maven similarly to calling Maven archetypes these recipes are called as a one-shot operation on a developers laptop. Take this call as an example: + +```bash +mvn org.openrewrite.maven:rewrite-maven-plugin:run \ + -Drewrite.recipeArtifactCoordinates=com.sap.cds:cds-services-recipes:4.3.0 \ + -Drewrite.activeRecipes=com.sap.cds.services.migrations.MigrateStatements \ + -DskipMavenParsing=true +``` + +Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` in the Maven artifact `com.sap.cds:cds-services-recipes:4.3.0` is called in the given project context. The *migration* is a container for one or more recipes. A recipe is a rule telling Open Rewrite how to come from code A to code B. + +This is the list of migrations we have released for CAP Java: + +|Name |Description|Available since| +|--------|-----------|---------------| +|[com.sap.cds.services.migrations.MigrateStatements](./releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0| \ No newline at end of file From 25f55eca18e3ff26edf6b684b31946e166f5ed2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jeglinsky?= Date: Tue, 11 Nov 2025 21:13:22 +0100 Subject: [PATCH 2/3] Update java/migration.md --- java/migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/migration.md b/java/migration.md index 9fdc2f4218..6ea130f559 100644 --- a/java/migration.md +++ b/java/migration.md @@ -1434,4 +1434,4 @@ This is the list of migrations we have released for CAP Java: |Name |Description|Available since| |--------|-----------|---------------| -|[com.sap.cds.services.migrations.MigrateStatements](./releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0| \ No newline at end of file +|[com.sap.cds.services.migrations.MigrateStatements](/releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0| \ No newline at end of file From ebe182dc2e2530ec629368614f007988f5383e2b Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Wed, 12 Nov 2025 15:54:01 +0100 Subject: [PATCH 3/3] address review comments --- java/migration.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/java/migration.md b/java/migration.md index 6ea130f559..d779c4edf5 100644 --- a/java/migration.md +++ b/java/migration.md @@ -1415,11 +1415,11 @@ After rebuilding and restarting your application, your Application Services are -## Automatic Java Migrations with Open Rewrite { #open-rewrite } +## Automatic Java Migrations with OpenRewrite { #open-rewrite } -Whenever we introduce new versions or replacements of an API version we try make the transition from the old version to the new version as smooth as possible. When possible we introduce a new version in the same major version as the version where deprecate the old version. This is the foundation for having automatic code migrations with [OpenRewrite](https://docs.openrewrite.org). At CAP Java, we aim to provide Open Rewrite Recipes for our API changes. +Whenever we introduce new versions or replacements of an API version, we try to make the transition from the old version to the new version as smooth as possible. When possible we introduce a new version in the same major version as the version where deprecate the old version. This is the foundation for having automatic code migrations with [OpenRewrite](https://docs.openrewrite.org). At CAP Java, we aim to provide OpenRewrite Recipes for our API changes. -The application of these recipes is done via Maven similarly to calling Maven archetypes these recipes are called as a one-shot operation on a developers laptop. Take this call as an example: +The application of these recipes is done via Maven as a one-shot operation on a developer's laptop, similar to calling Maven archetypes. Take this call as an example: ```bash mvn org.openrewrite.maven:rewrite-maven-plugin:run \ @@ -1428,10 +1428,10 @@ mvn org.openrewrite.maven:rewrite-maven-plugin:run \ -DskipMavenParsing=true ``` -Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` in the Maven artifact `com.sap.cds:cds-services-recipes:4.3.0` is called in the given project context. The *migration* is a container for one or more recipes. A recipe is a rule telling Open Rewrite how to come from code A to code B. +Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` in the Maven artifact `com.sap.cds:cds-services-recipes:4.3.0` is called in the given project context. The *migration* is a container for one or more recipes. A recipe is a rule that tells OpenRewrite how to transform code from version A to version B. This is the list of migrations we have released for CAP Java: |Name |Description|Available since| |--------|-----------|---------------| -|[com.sap.cds.services.migrations.MigrateStatements](/releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0| \ No newline at end of file +|[com.sap.cds.services.migrations.MigrateStatements](/releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0|