Skip to content

Commit 2e12795

Browse files
sruffattisruffatti-pngtimtebeek
authored
Spring Boot 3.5 and Spring Cloud 2025 declarative migration recipes (#770)
* spring boot 3.4 and 3.5 properties * Spring Boot 3.4 and 3.5 recipes * Update src/main/resources/META-INF/rewrite/spring-boot-34-properties.yml * Spring Boot 3.5 and Spring Cloud 2025 * Spring Boot 3.5 and Spring Cloud 2025 * removed a temporary unit test * removed a temporary unit test * Spring boot 3.4 properties recipe and removed Spring boot 3.5 recipes * spring boot 35 * Spring Boot 3.5 and Spring Cloud 2025 * Minimal test to trigger yaml recipe validation * Add a minimal test to show changed dependency version * Add a test for the Spring Cloud property renames * Use missing import * added except parameter to avoid sub-property key in spring cloud 2025 recipe * Add a minor clarifying comment --------- Co-authored-by: Sean Ruffatti <sruffatti@prove.com> Co-authored-by: Tim te Beek <timtebeek@gmail.com> Co-authored-by: Tim te Beek <tim@moderne.io>
1 parent 2df85a6 commit 2e12795

File tree

6 files changed

+503
-1
lines changed

6 files changed

+503
-1
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
group = "org.openrewrite.recipe"
77
description = "Eliminate legacy Spring patterns and migrate between major Spring Boot versions. Automatically."
88

9-
val springBootVersions: List<String> = listOf("1_5", "2_1", "2_2", "2_3", "2_4", "2_5", "2_6", "2_7", "3_0", "3_2", "3_3", "3_4")
9+
val springBootVersions: List<String> = listOf("1_5", "2_1", "2_2", "2_3", "2_4", "2_5", "2_6", "2_7", "3_0", "3_2", "3_3", "3_4", "3_5")
1010
val springSecurityVersions: List<String> = listOf("5_7", "5_8", "6_2")
1111

1212
val sourceSetNames: Map<String, List<String>> = mapOf(
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
#
2+
# Copyright 2025 the original author or authors.
3+
# <p>
4+
# Licensed under the Moderne Source Available License (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# <p>
8+
# https://docs.moderne.io/licensing/moderne-source-available-license
9+
# <p>
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# This file is automatically generated by the GeneratePropertiesMigratorConfiguration class.
17+
# Do not edit this file manually. Update the Spring Boot property metadata upstream instead.
18+
---
19+
type: specs.openrewrite.org/v1beta/recipe
20+
name: org.openrewrite.java.spring.boot3.SpringBootProperties_3_5
21+
displayName: Migrate Spring Boot properties to 3.5
22+
description: Migrate properties found in `application.properties` and `application.yml`.
23+
tags:
24+
- spring
25+
- boot
26+
recipeList:
27+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
28+
oldPropertyKey: management.promethus.metrics.export.pushgateway.base-url
29+
newPropertyKey: management.prometheus.metrics.export.pushgateway.address
30+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
31+
oldPropertyKey: spring.codec.log-request-details
32+
newPropertyKey: spring.http.codecs.log-request-details
33+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
34+
oldPropertyKey: spring.codec.max-in-memory-size
35+
newPropertyKey: spring.http.codecs.max-in-memory-size
36+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
37+
oldPropertyKey: spring.graphql.path
38+
newPropertyKey: spring.graphql.http.path
39+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
40+
oldPropertyKey: spring.graphql.sse.timeout
41+
newPropertyKey: spring.graphql.http.sse.timeout
42+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
43+
oldPropertyKey: spring.groovy.template.configuration.auto-escape
44+
newPropertyKey: spring.groovy.template.auto-escape
45+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
46+
oldPropertyKey: spring.groovy.template.configuration.auto-indent
47+
newPropertyKey: spring.groovy.template.auto-indent
48+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
49+
oldPropertyKey: spring.groovy.template.configuration.auto-indent-string
50+
newPropertyKey: spring.groovy.template.auto-indent-string
51+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
52+
oldPropertyKey: spring.groovy.template.configuration.auto-new-line
53+
newPropertyKey: spring.groovy.template.auto-new-line
54+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
55+
oldPropertyKey: spring.groovy.template.configuration.base-template-class
56+
newPropertyKey: spring.groovy.template.base-template-class
57+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
58+
oldPropertyKey: spring.groovy.template.configuration.cache-templates
59+
newPropertyKey: spring.groovy.template.cache
60+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
61+
oldPropertyKey: spring.groovy.template.configuration.declaration-encoding
62+
newPropertyKey: spring.groovy.template.declaration-encoding
63+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
64+
oldPropertyKey: spring.groovy.template.configuration.expand-empty-elements
65+
newPropertyKey: spring.groovy.template.expand-empty-elements
66+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
67+
oldPropertyKey: spring.groovy.template.configuration.locale
68+
newPropertyKey: spring.groovy.template.locale
69+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
70+
oldPropertyKey: spring.groovy.template.configuration.new-line-string
71+
newPropertyKey: spring.groovy.template.new-line-string
72+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
73+
oldPropertyKey: spring.groovy.template.configuration.resource-loader-path
74+
newPropertyKey: spring.groovy.template.resource-loader-path
75+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
76+
oldPropertyKey: spring.groovy.template.configuration.use-double-quotes
77+
newPropertyKey: spring.groovy.template.use-double-quotes
78+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
79+
oldPropertyKey: spring.mvc.converters.preferred-json-mapper
80+
newPropertyKey: spring.http.converters.preferred-json-mapper
81+
82+
- org.openrewrite.java.spring.CommentOutSpringPropertyKey:
83+
propertyKey: management.signalfx.metrics.export.access-token
84+
comment: "This property is deprecated: Deprecated in Micrometer 1.15.0"
85+
- org.openrewrite.java.spring.CommentOutSpringPropertyKey:
86+
propertyKey: management.signalfx.metrics.export.batch-size
87+
comment: "This property is deprecated: Deprecated in Micrometer 1.15.0"
88+
- org.openrewrite.java.spring.CommentOutSpringPropertyKey:
89+
propertyKey: management.signalfx.metrics.export.connect-timeout
90+
comment: "This property is deprecated: Deprecated in Micrometer 1.15.0"
91+
- org.openrewrite.java.spring.CommentOutSpringPropertyKey:
92+
propertyKey: management.signalfx.metrics.export.enabled
93+
comment: "This property is deprecated: Deprecated in Micrometer 1.15.0"
94+
- org.openrewrite.java.spring.CommentOutSpringPropertyKey:
95+
propertyKey: management.signalfx.metrics.export.published-histogram-type
96+
comment: "This property is deprecated: Deprecated in Micrometer 1.15.0"
97+
- org.openrewrite.java.spring.CommentOutSpringPropertyKey:
98+
propertyKey: management.signalfx.metrics.export.read-timeout
99+
comment: "This property is deprecated: Deprecated in Micrometer 1.15.0"
100+
- org.openrewrite.java.spring.CommentOutSpringPropertyKey:
101+
propertyKey: management.signalfx.metrics.export.source
102+
comment: "This property is deprecated: Deprecated in Micrometer 1.15.0"
103+
- org.openrewrite.java.spring.CommentOutSpringPropertyKey:
104+
propertyKey: management.signalfx.metrics.export.step
105+
comment: "This property is deprecated: Deprecated in Micrometer 1.15.0"
106+
- org.openrewrite.java.spring.CommentOutSpringPropertyKey:
107+
propertyKey: management.signalfx.metrics.export.uri
108+
comment: "This property is deprecated: Deprecated in Micrometer 1.15.0"
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#
2+
# Copyright 2025 the original author or authors.
3+
# <p>
4+
# Licensed under the Moderne Source Available License (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# <p>
8+
# https://docs.moderne.io/licensing/moderne-source-available-license
9+
# <p>
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
---
18+
type: specs.openrewrite.org/v1beta/recipe
19+
name: org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_5
20+
displayName: Migrate to Spring Boot 3.5
21+
description: >-
22+
Migrate applications to the latest Spring Boot 3.5 release. This recipe will modify an application's build files,
23+
make changes to deprecated/preferred APIs.
24+
tags:
25+
- spring
26+
- boot
27+
recipeList:
28+
- org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_4
29+
- org.openrewrite.java.spring.boot3.SpringBootProperties_3_5
30+
- org.openrewrite.java.spring.cloud2025.UpgradeSpringCloud_2025
31+
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
32+
groupId: org.springframework.boot
33+
artifactId: "*"
34+
newVersion: 3.5.x
35+
overrideManagedVersion: false
36+
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
37+
groupId: org.springframework.boot
38+
artifactId: spring-boot-dependencies
39+
newVersion: 3.5.x
40+
overrideManagedVersion: true
41+
- org.openrewrite.maven.UpgradePluginVersion:
42+
groupId: org.springframework.boot
43+
artifactId: spring-boot-maven-plugin
44+
newVersion: 3.5.x
45+
- org.openrewrite.maven.UpgradeParentVersion:
46+
groupId: org.springframework.boot
47+
artifactId: spring-boot-starter-parent
48+
newVersion: 3.5.x
49+
- org.openrewrite.gradle.plugins.UpgradePluginVersion:
50+
pluginIdPattern: org.springframework.boot
51+
newVersion: 3.5.x
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
#
2+
# Copyright 2025 the original author or authors.
3+
# <p>
4+
# Licensed under the Moderne Source Available License (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# <p>
8+
# https://docs.moderne.io/licensing/moderne-source-available-license
9+
# <p>
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
---
18+
type: specs.openrewrite.org/v1beta/recipe
19+
name: org.openrewrite.java.spring.cloud2025.UpgradeSpringCloud_2025
20+
displayName: Migrate to Spring Cloud 2025
21+
description: Migrate applications to the latest Spring Cloud 2025 (Northfields) release.
22+
tags:
23+
- spring
24+
- cloud
25+
recipeList:
26+
# Do not chain previous versions of Spring Cloud; leave inclusion up to Spring Boot migrations to avoid duplicates
27+
- org.openrewrite.java.spring.cloud2025.DependencyUpgrades
28+
- org.openrewrite.java.spring.cloud2025.SpringCloudGatewayDeprecatedModulesAndStarters
29+
- org.openrewrite.java.spring.cloud2025.SpringCloudGatewayProperties
30+
- org.openrewrite.java.spring.cloud2025.SpringCloudGatewayWebfluxProperties
31+
- org.openrewrite.java.spring.cloud2025.SpringCloudGatewayProxyWebfluxProperties
32+
- org.openrewrite.java.spring.cloud2025.SpringCloudGatewayWebMvcProperties
33+
- org.openrewrite.java.spring.cloud2025.SpringCloudGatewayProxyWebMvcProperties
34+
35+
---
36+
type: specs.openrewrite.org/v1beta/recipe
37+
name: org.openrewrite.java.spring.cloud2025.DependencyUpgrades
38+
displayName: Upgrade dependencies to Spring Cloud 2025
39+
description: Upgrade dependencies to Spring Cloud 2025 from prior 2024.x version.
40+
tags:
41+
- spring
42+
- cloud
43+
recipeList:
44+
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
45+
groupId: org.springframework.cloud
46+
artifactId: "*"
47+
newVersion: 4.3.x
48+
overrideManagedVersion: false
49+
- org.openrewrite.maven.UpgradeParentVersion:
50+
groupId: org.springframework.cloud
51+
artifactId: spring-cloud-starter-parent
52+
newVersion: 2025.0.x
53+
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
54+
groupId: org.springframework.cloud
55+
artifactId: spring-cloud-dependencies
56+
newVersion: 2025.0.x
57+
overrideManagedVersion: false
58+
59+
# circuitbreaker, kubernetes & task follow a different versioning scheme
60+
# https://docs.spring.io/spring-cloud-release/reference/2025.0/
61+
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
62+
groupId: org.springframework.cloud
63+
artifactId: spring-cloud-starter-circuitbreaker-*
64+
newVersion: 3.3.x
65+
overrideManagedVersion: false
66+
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
67+
groupId: org.springframework.cloud
68+
artifactId: spring-cloud-circuitbreaker-*
69+
newVersion: 3.3.x
70+
overrideManagedVersion: false
71+
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
72+
groupId: org.springframework.cloud
73+
artifactId: spring-cloud-starter-kubernetes-*
74+
newVersion: 3.3.x
75+
overrideManagedVersion: false
76+
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
77+
groupId: org.springframework.cloud
78+
artifactId: spring-cloud-kubernetes-*
79+
newVersion: 3.3.x
80+
overrideManagedVersion: false
81+
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
82+
groupId: org.springframework.cloud
83+
artifactId: spring-cloud-starter-task-*
84+
newVersion: 3.3.x
85+
overrideManagedVersion: false
86+
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
87+
groupId: org.springframework.cloud
88+
artifactId: spring-cloud-task-*
89+
newVersion: 3.3.x
90+
overrideManagedVersion: false
91+
92+
---
93+
type: specs.openrewrite.org/v1beta/recipe
94+
name: org.openrewrite.java.spring.cloud2025.SpringCloudGatewayDeprecatedModulesAndStarters
95+
displayName: Migrate to New Spring Cloud Gateway Modules and Starters
96+
description: Migrate to new Spring Cloud Gateway modules and starters for Spring Cloud 2025
97+
tags:
98+
- spring
99+
- cloud
100+
recipeList:
101+
- org.openrewrite.java.dependencies.ChangeDependency:
102+
oldGroupId: org.springframework.cloud
103+
oldArtifactId: spring-cloud-gateway-server
104+
newArtifactId: spring-cloud-gateway-server-webflux
105+
- org.openrewrite.java.dependencies.ChangeDependency:
106+
oldGroupId: org.springframework.cloud
107+
oldArtifactId: spring-cloud-gateway-server-mvc
108+
newArtifactId: spring-cloud-gateway-server-webmvc
109+
- org.openrewrite.java.dependencies.ChangeDependency:
110+
oldGroupId: org.springframework.cloud
111+
oldArtifactId: spring-cloud-starter-gateway-server
112+
newArtifactId: spring-cloud-starter-gateway-server-webflux
113+
- org.openrewrite.java.dependencies.ChangeDependency:
114+
oldGroupId: org.springframework.cloud
115+
oldArtifactId: spring-cloud-starter-gateway-server-mvc
116+
newArtifactId: spring-cloud-starter-gateway-server-webmvc
117+
- org.openrewrite.java.dependencies.ChangeDependency:
118+
oldGroupId: org.springframework.cloud
119+
oldArtifactId: spring-cloud-gateway-mvc
120+
newArtifactId: spring-cloud-gateway-proxyexchange-webmvc
121+
- org.openrewrite.java.dependencies.ChangeDependency:
122+
oldGroupId: org.springframework.cloud
123+
oldArtifactId: spring-cloud-gateway-webflux
124+
newArtifactId: spring-cloud-gateway-proxyexchange-webflux
125+
126+
---
127+
type: specs.openrewrite.org/v1beta/recipe
128+
name: org.openrewrite.java.spring.cloud2025.SpringCloudGatewayProperties
129+
displayName: Migrate Spring Cloud Gateway Properties
130+
description: Migrate Spring Cloud Gateway properties for Spring Cloud 2025 release.
131+
tags:
132+
- spring
133+
- cloud
134+
recipeList:
135+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
136+
oldPropertyKey: spring.cloud.gateway
137+
newPropertyKey: spring.cloud.gateway.server.webflux
138+
except: ["proxy"]
139+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
140+
oldPropertyKey: spring.cloud.gateway.mvc
141+
newPropertyKey: spring.cloud.gateway.server.webmvc
142+
143+
---
144+
type: specs.openrewrite.org/v1beta/recipe
145+
name: org.openrewrite.java.spring.cloud2025.SpringCloudGatewayWebfluxProperties
146+
displayName: Migrate Spring Cloud Gateway Webflux Properties
147+
description: Migrate Spring Cloud Gateway Webflux properties for Spring Cloud 2025 release.
148+
tags:
149+
- spring
150+
- cloud
151+
preconditions:
152+
- org.openrewrite.java.dependencies.search.ModuleHasDependency:
153+
groupIdPattern: org.springframework.cloud
154+
artifactIdPattern: spring-cloud-gateway-webflux
155+
recipeList:
156+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
157+
oldPropertyKey: spring.cloud.gateway.proxy
158+
newPropertyKey: spring.cloud.gateway.proxy-exchange.webflux
159+
160+
---
161+
type: specs.openrewrite.org/v1beta/recipe
162+
name: org.openrewrite.java.spring.cloud2025.SpringCloudGatewayProxyWebfluxProperties
163+
displayName: Migrate Spring Cloud Gateway Proxy Webflux Properties
164+
description: Migrate Spring Cloud Gateway Proxy Webflux properties for Spring Cloud 2025 release.
165+
tags:
166+
- spring
167+
- cloud
168+
preconditions:
169+
- org.openrewrite.java.dependencies.search.ModuleHasDependency:
170+
groupIdPattern: org.springframework.cloud
171+
artifactIdPattern: spring-cloud-gateway-proxyexchange-webflux
172+
recipeList:
173+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
174+
oldPropertyKey: spring.cloud.gateway.proxy
175+
newPropertyKey: spring.cloud.gateway.proxy-exchange.webflux
176+
177+
---
178+
type: specs.openrewrite.org/v1beta/recipe
179+
name: org.openrewrite.java.spring.cloud2025.SpringCloudGatewayWebMvcProperties
180+
displayName: Migrate Spring Cloud Gateway WebMvc Properties
181+
description: Migrate Spring Cloud Gateway WebMvc properties for Spring Cloud 2025 release.
182+
tags:
183+
- spring
184+
- cloud
185+
preconditions:
186+
- org.openrewrite.java.dependencies.search.ModuleHasDependency:
187+
groupIdPattern: org.springframework.cloud
188+
artifactIdPattern: spring-cloud-gateway-mvc
189+
recipeList:
190+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
191+
oldPropertyKey: spring.cloud.gateway.proxy
192+
newPropertyKey: spring.cloud.gateway.proxy-exchange.webmvc
193+
194+
---
195+
type: specs.openrewrite.org/v1beta/recipe
196+
name: org.openrewrite.java.spring.cloud2025.SpringCloudGatewayProxyWebMvcProperties
197+
displayName: Migrate Spring Cloud Gateway Proxy WebMvc Properties
198+
description: Migrate Spring Cloud Gateway Proxy WebMvc properties for Spring Cloud 2025 release.
199+
tags:
200+
- spring
201+
- cloud
202+
preconditions:
203+
- org.openrewrite.java.dependencies.search.ModuleHasDependency:
204+
groupIdPattern: org.springframework.cloud
205+
artifactIdPattern: spring-cloud-gateway-proxyexchange-webmvc
206+
recipeList:
207+
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
208+
oldPropertyKey: spring.cloud.gateway.proxy
209+
newPropertyKey: spring.cloud.gateway.proxy-exchange-webmvc

0 commit comments

Comments
 (0)