From 167d9ce84c446f7ea34fc8539c516166b74c77e0 Mon Sep 17 00:00:00 2001 From: ashakirin <2254222+ashakirin@users.noreply.github.com> Date: Tue, 26 Nov 2024 23:45:06 +0100 Subject: [PATCH] Generate comments for deprecated properties (#639) * Add relevant context to description of AddSpringDependencyManagementPlugin * Adopt RemoveMethodInvocations from rewrite-java * Remove now-defunct rewrite-templating dependency * refactor: Update Gradle wrapper Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.gradle.UpdateGradleWrapper?organizationId=T3BlblJld3JpdGU%3D#defaults=W3sibmFtZSI6ImFkZElmTWlzc2luZyIsInZhbHVlIjoiRmFsc2UifV0= Co-authored-by: Moderne * Fix method type following openrewrite/rewrite#4688 * Update method type as well when removing arguments * Fix incorrect path computation for Spring API endpoints (#632) * Fix incorrect path computation for Spring API endpoints The current logic did not cover the case where a `RequestMapping` with a path was defined on the Controller class, and no paths were defined in the `*Mapping` at the method level. * Do not disable the FindApiEndpointsTest * Simplify FindApiEndpoints and SpringRequestMapping * Add for now failing unit test * AnnotationMatcher does not support wildcards --------- Co-authored-by: Tim te Beek * Add commons codec dependency upgrade * feat: Added recipe to comment deprecated and removed properties without alternative Refs: #634 * feat: Added licences in recipe and test files Refs: #634 * feat: Removed NotNull annotations Refs: #634 * Update src/test/java/org/openrewrite/java/spring/InlineCommentSpringPropertiesTest.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/test/java/org/openrewrite/java/spring/InlineCommentSpringPropertiesTest.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/main/java/org/openrewrite/java/spring/InlineCommentSpringProperties.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/main/java/org/openrewrite/java/spring/InlineCommentSpringProperties.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/test/java/org/openrewrite/java/spring/InlineCommentSpringPropertiesTest.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat: Removed doubled import Refs: #634 * feat: Generated comment recipes for deprecated properties without replacement Refs: #634 * feat: Updated comment recipes with the reason Refs: #634 * Update src/test/java/org/openrewrite/java/spring/internal/GeneratePropertiesMigratorConfiguration.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Remove unused import in GeneratePropertiesMigratorConfiguration * Update assertions to ensure yaml comments are modeled as such * fixing SpringFoxToSpringDoc to use 1.x-appropriate springdoc artifact helps with #638 * ChangeSpringPropertyKey does not yet fully support glob * RenameBean Scanning Recipe Refactor (#630) * Refactored the RenameBean recipe into a scanning recipe to allow renaming usages that occur outside the file where the bean is defined. * Add missing language hints * Remove unused `fromDeclaration` methods --------- Co-authored-by: Hudson, Ryan Co-authored-by: Tim te Beek * Add MigrateSpringdocCommon recipe (#633) * Add MigrateSpringdocCommon recipe * Apply suggestions from bot Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix syntax messed up by bot * Add MigrateSpringdocCommon recipe * Apply suggestions from bot Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix syntax messed up by bot * Fix build fail on SpringBoot_1_5 * Fix rebase error * Move to Spring Boot 2.6 tests, to match inclusion in `spring-boot-26.yml` --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Tim te Beek * Add ChangeMethodParameter for modify parameters in Spring Batch method declaration (#631) * Add ChangeMethodParameter for modify parameters in method declaration Signed-off-by: Kun Chang * Minor polish * Add correct year * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Add UpgradeSkipPolicyParameterType for Spring Batch Signed-off-by: Kun Chang * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix tests * Also show ability to change interface methods --------- Signed-off-by: Kun Chang Co-authored-by: Tim te Beek Co-authored-by: Tim te Beek Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Reuse recipe that comments out Yaml properties * Move try into getDeprecations * Limit comment wrangling to `CommentOutSpringPropertyKey` * Rename test to match renamed class * Generate removed property migrations * Regenerated properties for older Spring Boot version * Fix invalid property values --------- Signed-off-by: Kun Chang Co-authored-by: Sam Snyder Co-authored-by: Tim te Beek Co-authored-by: Shannon Pamperl Co-authored-by: Moderne Co-authored-by: Adrien Loison <7086917+adrilo@users.noreply.github.com> Co-authored-by: Andrei Shakirin Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Nick McKinney Co-authored-by: Ryan Hudson <43145457+ryan-hudson@users.noreply.github.com> Co-authored-by: Hudson, Ryan Co-authored-by: SiBorea <108953913+SiBorea@users.noreply.github.com> Co-authored-by: Curtis Co-authored-by: Tim te Beek --- .../spring/ChangeSpringPropertyValue.java | 9 +- .../spring/CommentOutSpringPropertyKey.java | 69 +++ .../rewrite/spring-boot-20-properties.yml | 444 ++++++++++++++++-- .../rewrite/spring-boot-21-properties.yml | 110 ++++- .../rewrite/spring-boot-22-properties.yml | 114 ++++- .../rewrite/spring-boot-23-properties.yml | 158 ++++++- .../rewrite/spring-boot-24-properties.yml | 32 +- .../rewrite/spring-boot-25-properties.yml | 158 ++++++- .../rewrite/spring-boot-26-properties.yml | 23 +- .../rewrite/spring-boot-27-properties.yml | 14 +- .../rewrite/spring-boot-30-properties.yml | 128 ++++- .../rewrite/spring-boot-31-properties.yml | 10 + .../rewrite/spring-boot-32-properties.yml | 43 ++ .../rewrite/spring-boot-33-properties.yml | 13 + .../rewrite/spring-boot-34-properties.yml | 120 ----- .../spring/ChangeSpringPropertyValueTest.java | 8 +- .../CommentOutSpringPropertyKeyTest.java | 111 +++++ ...neratePropertiesMigratorConfiguration.java | 191 +++++--- 18 files changed, 1457 insertions(+), 298 deletions(-) create mode 100644 src/main/java/org/openrewrite/java/spring/CommentOutSpringPropertyKey.java delete mode 100644 src/main/resources/META-INF/rewrite/spring-boot-34-properties.yml create mode 100644 src/test/java/org/openrewrite/java/spring/CommentOutSpringPropertyKeyTest.java diff --git a/src/main/java/org/openrewrite/java/spring/ChangeSpringPropertyValue.java b/src/main/java/org/openrewrite/java/spring/ChangeSpringPropertyValue.java index 2f2144dce..3bb554686 100644 --- a/src/main/java/org/openrewrite/java/spring/ChangeSpringPropertyValue.java +++ b/src/main/java/org/openrewrite/java/spring/ChangeSpringPropertyValue.java @@ -20,7 +20,6 @@ import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.properties.ChangePropertyValue; import org.openrewrite.properties.tree.Properties; import org.openrewrite.yaml.tree.Yaml; @@ -63,7 +62,7 @@ public String getDescription() { @Option(displayName = "Use relaxed binding", description = "Whether to match the `propertyKey` using [relaxed binding](https://docs.spring.io/spring-boot/docs/2.5.6/reference/html/features.html#features.external-config.typesafe-configuration-properties.relaxed-binding) " + - "rules. Default is `true`. Set to `false` to use exact matching.", + "rules. Default is `true`. Set to `false` to use exact matching.", required = false) @Nullable Boolean relaxedBinding; @@ -77,10 +76,8 @@ public Validated validate() { @Override public TreeVisitor getVisitor() { - ChangePropertyValue changeProperties = new ChangePropertyValue(propertyKey, newValue, oldValue, regex, relaxedBinding); - org.openrewrite.yaml.ChangePropertyValue changeYaml = - new org.openrewrite.yaml.ChangePropertyValue(propertyKey, newValue, oldValue, regex, relaxedBinding, null); - + Recipe changeProperties = new org.openrewrite.properties.ChangePropertyValue(propertyKey, newValue, oldValue, regex, relaxedBinding); + Recipe changeYaml = new org.openrewrite.yaml.ChangePropertyValue(propertyKey, newValue, oldValue, regex, relaxedBinding, null); return new TreeVisitor() { @Override public @Nullable Tree visit(@Nullable Tree tree, ExecutionContext ctx) { diff --git a/src/main/java/org/openrewrite/java/spring/CommentOutSpringPropertyKey.java b/src/main/java/org/openrewrite/java/spring/CommentOutSpringPropertyKey.java new file mode 100644 index 000000000..aa81ca615 --- /dev/null +++ b/src/main/java/org/openrewrite/java/spring/CommentOutSpringPropertyKey.java @@ -0,0 +1,69 @@ +/* + * 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. + */ +package org.openrewrite.java.spring; + +import lombok.EqualsAndHashCode; +import lombok.Value; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; +import org.openrewrite.*; +import org.openrewrite.properties.tree.Properties; +import org.openrewrite.yaml.tree.Yaml; + +@EqualsAndHashCode(callSuper = false) +@Value +public class CommentOutSpringPropertyKey extends Recipe { + + @Override + public String getDisplayName() { + return "Comment out Spring properties"; + } + + @Override + public String getDescription() { + return "Add comment to specified Spring properties, and comment out the property."; + } + + @Option(displayName = "Property key", + description = "The name of the property key to comment out.", + example = "management.metrics.binders.files.enabled") + String propertyKey; + + @Option(displayName = "Comment", + description = "Comment to replace the property key.", + example = "This property is deprecated and no longer applicable starting from Spring Boot 3.0.x") + String comment; + + @Override + public TreeVisitor getVisitor() { + String inlineComment = " # " + comment; + String regex = "(?() { + @Override + public @Nullable Tree preVisit(@NonNull Tree tree, ExecutionContext ctx) { + stopAfterPreVisit(); + if (tree instanceof Properties.File) { + return changeProperties.getVisitor().visit(tree, ctx); + } else if (tree instanceof Yaml.Documents) { + return changeYaml.getVisitor().visit(tree, ctx); + } + return tree; + } + }; + } +} diff --git a/src/main/resources/META-INF/rewrite/spring-boot-20-properties.yml b/src/main/resources/META-INF/rewrite/spring-boot-20-properties.yml index e2e61d408..3ddfbf769 100644 --- a/src/main/resources/META-INF/rewrite/spring-boot-20-properties.yml +++ b/src/main/resources/META-INF/rewrite/spring-boot-20-properties.yml @@ -1,5 +1,5 @@ # -# Copyright 2023 the original author or authors. +# Copyright 2024 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. @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# This file is automatically generated by the GeneratePropertiesMigratorConfiguration class. +# Do not edit this file manually. Update the Spring Boot property metadata upstream instead. --- type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.spring.boot2.SpringBootProperties_2_0 @@ -22,12 +24,6 @@ tags: - spring - boot recipeList: - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.main.show-banner - newPropertyKey: spring.main.banner-mode - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.main.web-environment - newPropertyKey: spring.main.web-application-type - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: banner.charset newPropertyKey: spring.banner.charset @@ -49,27 +45,6 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: banner.location newPropertyKey: spring.banner.location - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: security.filter-dispatcher-types - newPropertyKey: spring.security.filter.dispatcher-types - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: security.filter-order - newPropertyKey: spring.security.filter.order - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.data.cassandra.repositories.enabled - newPropertyKey: spring.data.cassandra.repositories.type - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.data.couchbase.repositories.enabled - newPropertyKey: spring.data.couchbase.repositories.type - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.data.mongodb.repositories.enabled - newPropertyKey: spring.data.mongodb.repositories.type - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.jta.bitronix.properties.background-recovery-interval - newPropertyKey: spring.jta.bitronix.properties.background-recovery-interval-seconds - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.mvc.media-types - newPropertyKey: spring.mvc.contentnegotiation.media-types - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: flyway.baseline-description newPropertyKey: spring.flyway.baseline-description @@ -142,6 +117,9 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: flyway.validate-on-migrate newPropertyKey: spring.flyway.validate-on-migrate + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: jolokia.config + newPropertyKey: management.endpoint.jolokia.config - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: liquibase.change-log newPropertyKey: spring.liquibase.change-log @@ -244,12 +222,27 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.batch.initializer.enabled newPropertyKey: spring.batch.initialize-schema + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.couchbase.env.endpoints.query + newPropertyKey: spring.couchbase.env.endpoints.queryservice.max-endpoints + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.couchbase.env.endpoints.view + newPropertyKey: spring.couchbase.env.endpoints.viewservice.max-endpoints - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.data.cassandra.connect-timeout-millis newPropertyKey: spring.data.cassandra.connect-timeout - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.data.cassandra.read-timeout-millis newPropertyKey: spring.data.cassandra.read-timeout + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.data.cassandra.repositories.enabled + newPropertyKey: spring.data.cassandra.repositories.type + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.data.couchbase.repositories.enabled + newPropertyKey: spring.data.couchbase.repositories.type + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.data.mongodb.repositories.enabled + newPropertyKey: spring.data.mongodb.repositories.type - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.datasource.initialize newPropertyKey: spring.datasource.initialization-mode @@ -277,9 +270,27 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.http.multipart.resolve-lazily newPropertyKey: spring.servlet.multipart.resolve-lazily + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.jta.bitronix.properties.background-recovery-interval + newPropertyKey: spring.jta.bitronix.properties.background-recovery-interval-seconds + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.main.show-banner + newPropertyKey: spring.main.banner-mode + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.main.web-environment + newPropertyKey: spring.main.web-application-type - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.messages.cache-seconds newPropertyKey: spring.messages.cache-duration + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.metrics.export.statsd.host + newPropertyKey: management.metrics.export.statsd.host + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.metrics.export.statsd.port + newPropertyKey: management.metrics.export.statsd.port + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.mvc.media-types + newPropertyKey: spring.mvc.contentnegotiation.media-types - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.redis.pool.max-active newPropertyKey: spring.redis.jedis.pool.max-idle @@ -304,12 +315,6 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.thymeleaf.content-type newPropertyKey: spring.thymeleaf.servlet.content-type - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.couchbase.env.endpoints.query - newPropertyKey: spring.couchbase.env.endpoints.queryservice.max-endpoints - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.couchbase.env.endpoints.view - newPropertyKey: spring.couchbase.env.endpoints.viewservice.max-endpoints - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: endpoints.auditevents.enabled newPropertyKey: management.endpoint.auditevents.enabled @@ -454,18 +459,15 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: endpoints.shutdown.path newPropertyKey: management.endpoints.web.path-mapping.shutdown - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: endpoints.trace.filter.enabled - newPropertyKey: management.trace.http.enabled - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: endpoints.trace.enabled newPropertyKey: management.endpoint.httptrace.enabled + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: endpoints.trace.filter.enabled + newPropertyKey: management.trace.http.enabled - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: endpoints.trace.path newPropertyKey: management.endpoints.web.path-mapping.httptrace - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: jolokia.config - newPropertyKey: management.endpoint.jolokia.config - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: management.add-application-context-header newPropertyKey: management.server.add-application-context-header @@ -527,9 +529,363 @@ recipeList: oldPropertyKey: management.trace.include newPropertyKey: management.trace.http.include - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.metrics.export.statsd.host - newPropertyKey: management.metrics.export.statsd.host + oldPropertyKey: security.filter-dispatcher-types + newPropertyKey: spring.security.filter.dispatcher-types - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.metrics.export.statsd.port - newPropertyKey: management.metrics.export.statsd.port + oldPropertyKey: security.filter-order + newPropertyKey: spring.security.filter.order + + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.actuator.enabled + comment: "This property is deprecated: The \"actuator\" endpoint is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.actuator.path + comment: "This property is deprecated: The \"actuator\" endpoint is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.actuator.sensitive + comment: "This property is deprecated: The \"actuator\" endpoint is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.auditevents.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.autoconfig.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.autoconfig.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.beans.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.beans.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.configprops.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.configprops.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.docs.curies.enabled + comment: "This property is deprecated: The \"docs\" endpoint is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.docs.enabled + comment: "This property is deprecated: The \"docs\" endpoint is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.docs.path + comment: "This property is deprecated: The \"docs\" endpoint is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.docs.sensitive + comment: "This property is deprecated: The \"docs\" endpoint is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.dump.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.dump.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.env.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.env.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.flyway.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.flyway.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.health.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.health.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.heapdump.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.hypermedia.enabled + comment: "This property is deprecated: Hypermedia support in the Actuator is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.info.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.info.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.jolokia.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.liquibase.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.liquibase.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.logfile.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.loggers.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.loggers.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.mappings.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.mappings.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.metrics.filter.counter-submissions + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.metrics.filter.enabled + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.metrics.filter.gauge-submissions + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.metrics.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.metrics.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.shutdown.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.shutdown.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.trace.id + comment: "This property is deprecated: Endpoint identifier is no longer customizable." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: endpoints.trace.sensitive + comment: "This property is deprecated: Endpoint sensitive flag is no longer customizable as Spring Boot no longer provides a customizable security auto-configuration +. Create or adapt your security configuration accordingly." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: flyway.init-description + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: flyway.init-on-migrate + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: flyway.init-version + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.health.couchbase.timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.statsd.queue-size + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.security.enabled + comment: "This property is deprecated: A global security auto-configuration is now provided. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.security.roles + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.security.sessions + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.auth.jaas.domain + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.auth.key.path + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.auth.simple.user.name + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.auth.simple.user.password + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.auth.spring.roles + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.auth.type + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.command-path-patterns + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.command-refresh-interval + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.config-path-patterns + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.disabled-commands + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.disabled-plugins + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.ssh.auth-timeout + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.ssh.enabled + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.ssh.idle-timeout + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.ssh.key-path + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.ssh.port + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.telnet.enabled + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.shell.telnet.port + comment: "This property is deprecated: CRaSH support is no longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.basic.authorize-mode + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.basic.enabled + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.basic.path + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.basic.realm + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.enable-csrf + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.headers.cache + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.headers.content-security-policy + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.headers.content-security-policy-mode + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.headers.content-type + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.headers.frame + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.headers.hsts + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.headers.xss + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.ignored + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.require-ssl + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: security.sessions + comment: "This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: server.max-http-post-size + comment: "This property is deprecated: Use dedicated property for each container." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: server.undertow.buffers-per-region + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.activemq.pool.create-connection-on-startup + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.activemq.pool.expiry-timeout + comment: "This property is deprecated: Use idle-timeout instead" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.activemq.pool.reconnect-on-exception + comment: "This property is deprecated: Disabling this option will likely lead to broken connections in the pool." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.application.index + comment: "This property is deprecated: Application context ids are now unique by default." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.neo4j.compiler + comment: "This property is deprecated: Not supported anymore as of Neo4j 3." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.datasource.hikari.initialization-fail-fast + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.datasource.hikari.jdbc4-connection-test + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.datasource.hikari.scheduled-executor-service + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.devtools.remote.debug.enabled + comment: "This property is deprecated: Remote debug is no longer supported." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.devtools.remote.debug.local-port + comment: "This property is deprecated: Remote debug is no longer supported." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jpa.hibernate.naming.strategy + comment: "This property is deprecated: Auto-configuration for Hibernate 4 is no longer provided." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.metrics.export.aggregate.key-pattern + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.metrics.export.aggregate.prefix + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.metrics.export.delay-millis + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.metrics.export.enabled + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.metrics.export.excludes + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.metrics.export.includes + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.metrics.export.redis.key + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.metrics.export.redis.prefix + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.metrics.export.send-latest + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.metrics.export.statsd.prefix + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.metrics.export.triggers + comment: "This property is deprecated: Metrics support is now using Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.sendgrid.password + comment: "This property is deprecated: The use of a username and password is no longer supported (Use spring.sendgrid.api-key instead)." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.sendgrid.username + comment: "This property is deprecated: The use of a username and password is no longer supported (Use spring.sendgrid.api-key instead)." + diff --git a/src/main/resources/META-INF/rewrite/spring-boot-21-properties.yml b/src/main/resources/META-INF/rewrite/spring-boot-21-properties.yml index cd6835672..112693398 100644 --- a/src/main/resources/META-INF/rewrite/spring-boot-21-properties.yml +++ b/src/main/resources/META-INF/rewrite/spring-boot-21-properties.yml @@ -1,5 +1,5 @@ # -# Copyright 2023 the original author or authors. +# Copyright 2024 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. @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# This file is automatically generated by the GeneratePropertiesMigratorConfiguration class. +# Do not edit this file manually. Update the Spring Boot property metadata upstream instead. --- type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.spring.boot2.SpringBootProperties_2_1 @@ -22,9 +24,24 @@ tags: - spring - boot recipeList: + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.endpoints.jmx.unique-names + newPropertyKey: spring.jmx.unique-names + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.metrics.binders.files.enabled + newPropertyKey: management.metrics.enable.process.files + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.metrics.binders.jvm.enabled + newPropertyKey: management.metrics.enable.jvm + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.metrics.binders.logback.enabled + newPropertyKey: management.metrics.enable.logback - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: server.jetty.max-http-post-size newPropertyKey: server.jetty.max-http-form-post-size + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: server.servlet-path + newPropertyKey: spring.mvc.servlet.path - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: server.servlet.path newPropertyKey: spring.mvc.servlet.path @@ -100,16 +117,83 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.resources.chain.gzipped newPropertyKey: spring.resources.chain.compressed - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.metrics.binders.files.enabled - newPropertyKey: management.metrics.enable.process.files - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.metrics.binders.jvm.enabled - newPropertyKey: management.metrics.enable.jvm - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.metrics.binders.logback.enabled - newPropertyKey: management.metrics.enable.logback - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoints.jmx.unique-names - newPropertyKey: spring.jmx.unique-names + + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: liquibase.check-change-log-location + comment: "This property is deprecated: Liquibase has its own check that checks if the change log location exists making this property redundant." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.binders.processor.enabled + comment: "This property is deprecated: Instead, filter 'system.cpu' and 'process.cpu' metrics." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.binders.uptime.enabled + comment: "This property is deprecated: Instead, filter 'process.uptime' and 'process.start.time' metrics." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: server.connection-timeout + comment: "This property is deprecated: Each server behaves differently. Use server specific properties instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.couchbase.env.endpoints.query + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.couchbase.env.endpoints.view + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.cassandra.load-balancing-policy + comment: "This property is deprecated: Implement a ClusterBuilderCustomizer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.cassandra.reconnection-policy + comment: "This property is deprecated: Implement a ClusterBuilderCustomizer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.cassandra.retry-policy + comment: "This property is deprecated: Implement a ClusterBuilderCustomizer bean instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.flyway.dry-run-output + comment: "This property is deprecated: Flyway pro edition only." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.flyway.error-handlers + comment: "This property is deprecated: Flyway pro edition only." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.flyway.undo-sql-migration-prefix + comment: "This property is deprecated: Flyway pro edition only." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.narayana.default-timeout + comment: "This property is deprecated: Narayana support has moved to third party starter." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.narayana.expiry-scanners + comment: "This property is deprecated: Narayana support has moved to third party starter." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.narayana.log-dir + comment: "This property is deprecated: Narayana support has moved to third party starter." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.narayana.one-phase-commit + comment: "This property is deprecated: Narayana support has moved to third party starter." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.narayana.periodic-recovery-period + comment: "This property is deprecated: Narayana support has moved to third party starter." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.narayana.recovery-backoff-period + comment: "This property is deprecated: Narayana support has moved to third party starter." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.narayana.recovery-db-pass + comment: "This property is deprecated: Narayana support has moved to third party starter." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.narayana.recovery-db-user + comment: "This property is deprecated: Narayana support has moved to third party starter." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.narayana.recovery-jms-pass + comment: "This property is deprecated: Narayana support has moved to third party starter." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.narayana.recovery-jms-user + comment: "This property is deprecated: Narayana support has moved to third party starter." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.narayana.recovery-modules + comment: "This property is deprecated: Narayana support has moved to third party starter." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.narayana.transaction-manager-id + comment: "This property is deprecated: Narayana support has moved to third party starter." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.narayana.xa-resource-orphan-filters + comment: "This property is deprecated: Narayana support has moved to third party starter." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.liquibase.check-change-log-location + comment: "This property is deprecated: Liquibase has it's own check that checks if the change log location exists making this property redundant." diff --git a/src/main/resources/META-INF/rewrite/spring-boot-22-properties.yml b/src/main/resources/META-INF/rewrite/spring-boot-22-properties.yml index e2137c2c0..021b783d1 100644 --- a/src/main/resources/META-INF/rewrite/spring-boot-22-properties.yml +++ b/src/main/resources/META-INF/rewrite/spring-boot-22-properties.yml @@ -1,5 +1,5 @@ # -# Copyright 2023 the original author or authors. +# Copyright 2024 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. @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# This file is automatically generated by the GeneratePropertiesMigratorConfiguration class. +# Do not edit this file manually. Update the Spring Boot property metadata upstream instead. --- type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.spring.boot2.SpringBootProperties_2_2 @@ -22,6 +24,21 @@ tags: - spring - boot recipeList: + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.health.status.http-mapping + newPropertyKey: management.endpoint.health.status.http-mapping + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.health.status.order + newPropertyKey: management.endpoint.health.status.order + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.metrics.web.client.requests-metric-name + newPropertyKey: management.metrics.web.client.request.metric-name + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.metrics.web.server.auto-time-requests + newPropertyKey: management.metrics.web.server.request.autotime.enabled + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.metrics.web.server.requests-metric-name + newPropertyKey: management.metrics.web.server.request.metric-name - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: server.jetty.accesslog.date-format newPropertyKey: server.jetty.accesslog.custom-format @@ -43,15 +60,12 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: server.jetty.accesslog.time-zone newPropertyKey: server.jetty.accesslog.custom-format - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.datasource.jmx-enabled - newPropertyKey: spring.datasource.tomcat.jmx-enabled - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.reactor.stacktrace-mode.enabled - newPropertyKey: spring.reactor.debug-agent.enabled - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: server.use-forward-headers newPropertyKey: server.forward-headers-strategy + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.datasource.jmx-enabled + newPropertyKey: spring.datasource.tomcat.jmx-enabled - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.jackson.joda-date-time-format newPropertyKey: dateFormat @@ -61,6 +75,10 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.rabbitmq.publisher-confirms newPropertyKey: spring.rabbitmq.publisher-confirm-type + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.reactor.stacktrace-mode.enabled + newPropertyKey: spring.reactor.debug-agent.enabled + - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: logging.file newPropertyKey: logging.file.name @@ -68,19 +86,71 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: logging.path newPropertyKey: logging.file.path - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.health.status.http-mapping - newPropertyKey: management.endpoint.health.status.http-mapping - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.health.status.order - newPropertyKey: management.endpoint.health.status.order - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.metrics.web.client.requests-metric-name - newPropertyKey: management.metrics.web.client.request.metric-name - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.metrics.web.server.auto-time-requests - newPropertyKey: management.metrics.web.server.request.autotime.enabled - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.metrics.web.server.requests-metric-name - newPropertyKey: management.metrics.web.server.request.metric-name + + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.health.elasticsearch.indices + comment: "This property is deprecated: Upstream elasticsearch transport is deprecated." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.health.elasticsearch.response-timeout + comment: "This property is deprecated: Upstream elasticsearch transport is deprecated." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.appoptics.num-threads + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.datadog.num-threads + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.dynatrace.num-threads + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.elastic.num-threads + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.humio.num-threads + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.humio.repository + comment: "This property is deprecated: No longer used as repository is resolved from the api token." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.influx.num-threads + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.kairos.num-threads + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.newrelic.num-threads + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.signalfx.num-threads + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.wavefront.num-threads + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.elasticsearch.cluster-name + comment: "This property is deprecated: The transport client support is deprecated. Use other supported clients instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.elasticsearch.cluster-nodes + comment: "This property is deprecated: The transport client support is deprecated. Use other supported clients instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.elasticsearch.properties + comment: "This property is deprecated: The transport client support is deprecated. Use other supported clients instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.datasource.dbcp2.enable-auto-commit-on-return + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.elasticsearch.jest.uris + comment: "This property is deprecated: The Jest client support is deprecated. Use other supported clients instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.mvc.contentnegotiation.favor-path-extension + comment: "This property is deprecated: Use of path extensions for request mapping and for content negotiation is discouraged." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.mvc.favicon.enabled + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.mvc.pathmatch.use-registered-suffix-pattern + comment: "This property is deprecated: Use of path extensions for request mapping and for content negotiation is discouraged." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.mvc.pathmatch.use-suffix-pattern + comment: "This property is deprecated: Use of path extensions for request mapping and for content negotiation is discouraged." diff --git a/src/main/resources/META-INF/rewrite/spring-boot-23-properties.yml b/src/main/resources/META-INF/rewrite/spring-boot-23-properties.yml index 2d03c737e..602769b77 100644 --- a/src/main/resources/META-INF/rewrite/spring-boot-23-properties.yml +++ b/src/main/resources/META-INF/rewrite/spring-boot-23-properties.yml @@ -1,5 +1,5 @@ # -# Copyright 2023 the original author or authors. +# Copyright 2024 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. @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# This file is automatically generated by the GeneratePropertiesMigratorConfiguration class. +# Do not edit this file manually. Update the Spring Boot property metadata upstream instead. --- type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.spring.boot2.SpringBootProperties_2_3 @@ -22,6 +24,12 @@ tags: - spring - boot recipeList: + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.health.probes.enabled + newPropertyKey: management.endpoint.health.probes.enabled + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.metrics.distribution.sla + newPropertyKey: management.metrics.distribution.slo - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: server.jetty.acceptors newPropertyKey: server.jetty.threads.acceptors @@ -136,10 +144,146 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.webflux.date-format newPropertyKey: spring.webflux.format.date - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.health.probes.enabled - newPropertyKey: management.endpoint.health.probes.enabled - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.metrics.distribution.sla - newPropertyKey: management.metrics.distribution.slo + + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.ganglia.protocol-version + comment: "This property is deprecated: No longer used by Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.ganglia.rate-units + comment: "This property is deprecated: No longer used by Micrometer." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.stackdriver.num-threads + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.wavefront.connect-timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.wavefront.read-timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.couchbase.bucket.name + comment: "This property is deprecated: A bucket is no longer auto-configured." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.couchbase.bucket.password + comment: "This property is deprecated: A bucket is no longer auto-configured." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.couchbase.env.bootstrap.http-direct-port + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.couchbase.env.bootstrap.http-ssl-port + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.couchbase.env.endpoints.key-value + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.couchbase.env.timeouts.socket-connect + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.cassandra.jmx-enabled + comment: "This property is deprecated: Cassandra no longer provides JMX metrics." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.cassandra.pool.pool-timeout + comment: "This property is deprecated: No longer available." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.couchbase.consistency + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.solr.repositories.enabled + comment: "This property is deprecated: Spring Data Solr is deprecated." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.elasticsearch.jest.connection-timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.elasticsearch.jest.multi-threaded + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.elasticsearch.jest.password + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.elasticsearch.jest.proxy.host + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.elasticsearch.jest.proxy.port + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.elasticsearch.jest.read-timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.elasticsearch.jest.username + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jackson.joda-date-time-format + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.allow-multiple-lrc + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.asynchronous2-pc + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.background-recovery-interval-seconds + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.current-node-only-recovery + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.debug-zero-resource-transaction + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.default-transaction-timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.disable-jmx + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.exception-analyzer + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.filter-log-status + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.force-batching-enabled + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.forced-write-enabled + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.graceful-shutdown-interval + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.jndi-transaction-synchronization-registry-name + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.jndi-user-transaction-name + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.journal + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.log-part1-filename + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.log-part2-filename + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.max-log-size-in-mb + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.resource-configuration-filename + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.server-id + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.skip-corrupted-logs + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.warn-about-zero-resource-transaction + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.rabbitmq.listener.simple.transaction-size + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.rabbitmq.publisher-confirms + comment: "This property is deprecated and will be removed in future Spring Boot versions" diff --git a/src/main/resources/META-INF/rewrite/spring-boot-24-properties.yml b/src/main/resources/META-INF/rewrite/spring-boot-24-properties.yml index e91b385ad..1ef29d34f 100644 --- a/src/main/resources/META-INF/rewrite/spring-boot-24-properties.yml +++ b/src/main/resources/META-INF/rewrite/spring-boot-24-properties.yml @@ -1,5 +1,5 @@ # -# Copyright 2023 the original author or authors. +# Copyright 2024 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. @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# This file is automatically generated by the GeneratePropertiesMigratorConfiguration class. +# Do not edit this file manually. Update the Spring Boot property metadata upstream instead. --- type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.spring.boot2.SpringBootProperties_2_4 @@ -22,9 +24,6 @@ tags: - spring - boot recipeList: - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.server.servlet.context-path - newPropertyKey: management.server.base-path - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: logging.file.clean-history-on-start newPropertyKey: logging.logback.rollingpolicy.clean-history-on-start @@ -41,9 +40,8 @@ recipeList: oldPropertyKey: logging.pattern.rolling-file-name newPropertyKey: logging.logback.rollingpolicy.file-name-pattern - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.profiles - newPropertyKey: spring.config.activate.on-profile - except: [ active, default, group, include ] + oldPropertyKey: management.server.servlet.context-path + newPropertyKey: management.server.base-path - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.data.mongodb.grid-fs-database newPropertyKey: spring.data.mongodb.gridfs.database @@ -65,6 +63,10 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.mvc.locale-resolver newPropertyKey: spring.web.locale-resolver + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.profiles + newPropertyKey: spring.config.activate.on-profile + except: [ active, default, group, include ] - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.resources.add-mappings newPropertyKey: spring.web.resources.add-mappings @@ -135,3 +137,19 @@ recipeList: oldPropertyKey: spring.resources.static-locations newPropertyKey: spring.web.resources.static-locations + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.neo4j.auto-index + comment: "This property is deprecated: Automatic index creation is no longer supported." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.neo4j.embedded.enabled + comment: "This property is deprecated: Embedded mode is no longer supported, please use Testcontainers instead." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.neo4j.open-in-view + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.neo4j.use-native-types + comment: "This property is deprecated: Native type support is now built-in." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.resources.chain.html-application-cache + comment: "This property is deprecated: The appcache manifest feature is being removed from browsers." + diff --git a/src/main/resources/META-INF/rewrite/spring-boot-25-properties.yml b/src/main/resources/META-INF/rewrite/spring-boot-25-properties.yml index e4b0c9b41..64fb03cea 100644 --- a/src/main/resources/META-INF/rewrite/spring-boot-25-properties.yml +++ b/src/main/resources/META-INF/rewrite/spring-boot-25-properties.yml @@ -1,5 +1,5 @@ # -# Copyright 2023 the original author or authors. +# Copyright 2024 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. @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# This file is automatically generated by the GeneratePropertiesMigratorConfiguration class. +# Do not edit this file manually. Update the Spring Boot property metadata upstream instead. --- type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.spring.boot2.SpringBootProperties_2_5 @@ -31,12 +33,18 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.batch.initialize-schema newPropertyKey: spring.batch.jdbc.initialize-schema + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.batch.initializer.enabled + newPropertyKey: spring.batch.jdbc.initialize-schema - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.batch.schema newPropertyKey: spring.batch.jdbc.schema - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.batch.table-prefix newPropertyKey: spring.batch.jdbc.table-prefix + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.data.neo4j.username + newPropertyKey: spring.neo4j.authentication.username - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.datasource.continue-on-error newPropertyKey: spring.sql.init.continue-on-error @@ -74,3 +82,151 @@ recipeList: oldPropertyKey: spring.sql.init.enabled newPropertyKey: spring.sql.init.mode + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.flyway.check-location + comment: "This property is deprecated: Locations can no longer be checked accurately due to changes in Flyway's location support." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.acquire-increment + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.acquisition-interval + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.acquisition-timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.allow-local-transactions + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.apply-transaction-timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.automatic-enlisting-enabled + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.cache-producers-consumers + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.class-name + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.defer-connection-release + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.disabled + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.driver-properties + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.ignore-recovery-failures + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.max-idle-time + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.max-pool-size + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.min-pool-size + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.password + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.share-transaction-connections + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.test-connections + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.two-pc-ordering-position + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.unique-name + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.use-tm-join + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.connectionfactory.user + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.acquire-increment + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.acquisition-interval + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.acquisition-timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.allow-local-transactions + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.apply-transaction-timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.automatic-enlisting-enabled + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.class-name + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.cursor-holdability + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.defer-connection-release + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.disabled + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.driver-properties + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.enable-jdbc4-connection-test + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.ignore-recovery-failures + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.isolation-level + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.local-auto-commit + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.login-timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.max-idle-time + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.max-pool-size + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.min-pool-size + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.prepared-statement-cache-size + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.share-transaction-connections + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.test-query + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.two-pc-ordering-position + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.unique-name + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.datasource.use-tm-join + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jta.bitronix.properties.background-recovery-interval + comment: "This property is deprecated and will be removed in future Spring Boot versions" + diff --git a/src/main/resources/META-INF/rewrite/spring-boot-26-properties.yml b/src/main/resources/META-INF/rewrite/spring-boot-26-properties.yml index da46139a2..5d9e68667 100644 --- a/src/main/resources/META-INF/rewrite/spring-boot-26-properties.yml +++ b/src/main/resources/META-INF/rewrite/spring-boot-26-properties.yml @@ -1,5 +1,5 @@ # -# Copyright 2023 the original author or authors. +# Copyright 2024 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. @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# This file is automatically generated by the GeneratePropertiesMigratorConfiguration class. +# Do not edit this file manually. Update the Spring Boot property metadata upstream instead. --- type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.spring.boot2.SpringBootProperties_2_6 @@ -85,7 +87,26 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.flyway.oracle-kerberos-config-file newPropertyKey: spring.flyway.kerberos-config-file + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.resources.chain.gzipped + newPropertyKey: spring.web.resources.chain.compressed - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.webflux.session.cookie.same-site newPropertyKey: server.reactive.session.cookie.same-site + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.data.elasticsearch.client.reactive.use-ssl + comment: "This property is deprecated: Use of SSL should be indicated through an https URI scheme" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.flyway.vault-secrets + comment: "This property is deprecated: Removed in the open source release of Flyway 7.12." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.flyway.vault-token + comment: "This property is deprecated: Removed in the open source release of Flyway 7.12." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.flyway.vault-url + comment: "This property is deprecated: Removed in the open source release of Flyway 7.12." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.kafka.listener.only-log-record-metadata + comment: "This property is deprecated: Use KafkaUtils#setConsumerRecordFormatter instead." + diff --git a/src/main/resources/META-INF/rewrite/spring-boot-27-properties.yml b/src/main/resources/META-INF/rewrite/spring-boot-27-properties.yml index 5ab6e989a..4a4868c61 100644 --- a/src/main/resources/META-INF/rewrite/spring-boot-27-properties.yml +++ b/src/main/resources/META-INF/rewrite/spring-boot-27-properties.yml @@ -1,5 +1,5 @@ # -# Copyright 2023 the original author or authors. +# Copyright 2024 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. @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# This file is automatically generated by the GeneratePropertiesMigratorConfiguration class. +# Do not edit this file manually. Update the Spring Boot property metadata upstream instead. --- type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.spring.boot2.SpringBootProperties_2_7 @@ -50,3 +52,13 @@ recipeList: oldPropertyKey: spring.security.oauth2.resourceserver.jwt.jws-algorithm newPropertyKey: spring.security.oauth2.resourceserver.jwt.jws-algorithms + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: server.tomcat.reject-illegal-header + comment: "This property is deprecated: The setting has been deprecated in Tomcat" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: server.undertow.allow-encoded-slash + comment: "This property is deprecated: This option was interpreted improperly" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.mongodb.embedded.features + comment: "This property is deprecated: Feature support has been removed from Embedded Mongo. A custom MongodConfig bean should be defined instead." + diff --git a/src/main/resources/META-INF/rewrite/spring-boot-30-properties.yml b/src/main/resources/META-INF/rewrite/spring-boot-30-properties.yml index 75da8ce72..14687b0da 100644 --- a/src/main/resources/META-INF/rewrite/spring-boot-30-properties.yml +++ b/src/main/resources/META-INF/rewrite/spring-boot-30-properties.yml @@ -1,5 +1,5 @@ # -# Copyright 2023 the original author or authors. +# Copyright 2024 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. @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# This file is automatically generated by the GeneratePropertiesMigratorConfiguration class. +# Do not edit this file manually. Update the Spring Boot property metadata upstream instead. --- type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.spring.boot3.SpringBootProperties_3_0 @@ -604,6 +606,9 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: management.trace.http.include newPropertyKey: management.httpexchanges.recording.include + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.trace.include + newPropertyKey: management.httpexchanges.recording.include - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: server.undertow.allow-encoded-slash newPropertyKey: server.undertow.decode-slash @@ -640,6 +645,9 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.data.cassandra.pool.idle-timeout newPropertyKey: spring.cassandra.pool.idle-timeout + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.data.cassandra.pool.max-queue-size + newPropertyKey: spring.cassandra.request.throttler.max-queue-size - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.data.cassandra.port newPropertyKey: spring.cassandra.port @@ -749,3 +757,121 @@ recipeList: oldPropertyKey: spring.redis.username newPropertyKey: spring.data.redis.username + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.export.atlas.num-threads + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.graphql.autotime.enabled + comment: "This property is deprecated: Should be applied at the ObservationRegistry level." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.graphql.autotime.percentiles + comment: "This property is deprecated: Should be applied at the ObservationRegistry level." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.graphql.autotime.percentiles-histogram + comment: "This property is deprecated: Should be applied at the ObservationRegistry level." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.web.client.request.autotime.enabled + comment: "This property is deprecated: Should be applied at the ObservationRegistry level." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.web.client.request.autotime.percentiles + comment: "This property is deprecated: Should be applied at the ObservationRegistry level." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.web.client.request.autotime.percentiles-histogram + comment: "This property is deprecated: Should be applied at the ObservationRegistry level." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.web.server.request.autotime.enabled + comment: "This property is deprecated: Should be applied at the ObservationRegistry level." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.web.server.request.autotime.percentiles + comment: "This property is deprecated: Should be applied at the ObservationRegistry level." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.web.server.request.autotime.percentiles-histogram + comment: "This property is deprecated: Should be applied at the ObservationRegistry level." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.metrics.web.server.request.ignore-trailing-slash + comment: "This property is deprecated: Not needed anymore, direct instrumentation in Spring MVC." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: server.max-http-header-size + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: server.netty.max-chunk-size + comment: "This property is deprecated: Deprecated for removal in Reactor Netty" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: server.servlet.session.cookie.comment + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.banner.image.bitdepth + comment: "This property is deprecated: Support for image banners has been removed." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.banner.image.height + comment: "This property is deprecated: Support for image banners has been removed." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.banner.image.invert + comment: "This property is deprecated: Support for image banners has been removed." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.banner.image.location + comment: "This property is deprecated: Support for image banners has been removed." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.banner.image.margin + comment: "This property is deprecated: Support for image banners has been removed." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.banner.image.pixelmode + comment: "This property is deprecated: Support for image banners has been removed." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.banner.image.width + comment: "This property is deprecated: Support for image banners has been removed." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.elasticsearch.webclient.max-in-memory-size + comment: "This property is deprecated: Reactive Elasticsearch client no longer uses WebClient." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.flyway.baseline-migration-prefix + comment: "This property is deprecated: Removed in Flyway 9.0" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.jpa.hibernate.use-new-id-generator-mappings + comment: "This property is deprecated: Hibernate no longer supports disabling the use of new ID generator mappings." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.mvc.date-format + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.mvc.ignore-default-model-on-redirect + comment: "This property is deprecated: Deprecated for removal in Spring MVC" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.redis.jedis.pool.enabled + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.redis.jedis.pool.max-active + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.redis.jedis.pool.max-idle + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.redis.jedis.pool.max-wait + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.redis.jedis.pool.min-idle + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.redis.jedis.pool.time-between-eviction-runs + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.redis.lettuce.pool.enabled + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.redis.lettuce.pool.max-active + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.redis.lettuce.pool.max-idle + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.redis.lettuce.pool.max-wait + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.redis.lettuce.pool.min-idle + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.redis.lettuce.pool.time-between-eviction-runs + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.webflux.multipart.streaming + comment: "This property is deprecated: Replaced by the PartEventHttpMessageReader and the PartEvent API." + diff --git a/src/main/resources/META-INF/rewrite/spring-boot-31-properties.yml b/src/main/resources/META-INF/rewrite/spring-boot-31-properties.yml index 68c949e35..e5ba864c1 100644 --- a/src/main/resources/META-INF/rewrite/spring-boot-31-properties.yml +++ b/src/main/resources/META-INF/rewrite/spring-boot-31-properties.yml @@ -27,6 +27,9 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.cassandra.ssl newPropertyKey: spring.cassandra.ssl.enabled + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.data.cassandra.ssl + newPropertyKey: spring.cassandra.ssl.enabled - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.data.redis.ssl newPropertyKey: spring.data.redis.ssl.enabled @@ -34,3 +37,10 @@ recipeList: oldPropertyKey: spring.kafka.streams.cache-max-size-buffering newPropertyKey: spring.kafka.streams.state-store-cache-max-size + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.couchbase.env.ssl.key-store + comment: "This property is deprecated: SSL bundle support with spring.ssl.bundle and spring.couchbase.env.ssl.bundle should be used instead" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.couchbase.env.ssl.key-store-password + comment: "This property is deprecated: SSL bundle support with spring.ssl.bundle and spring.couchbase.env.ssl.bundle should be used instead" + diff --git a/src/main/resources/META-INF/rewrite/spring-boot-32-properties.yml b/src/main/resources/META-INF/rewrite/spring-boot-32-properties.yml index 9e49ceac8..ee940a798 100644 --- a/src/main/resources/META-INF/rewrite/spring-boot-32-properties.yml +++ b/src/main/resources/META-INF/rewrite/spring-boot-32-properties.yml @@ -24,6 +24,12 @@ tags: - spring - boot recipeList: + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.metrics.web.client.requests-metric-name + newPropertyKey: management.observations.http.client.requests.name + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: management.metrics.web.server.requests-metric-name + newPropertyKey: management.observations.http.server.requests.name - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: management.otlp.metrics.export.resource-attributes newPropertyKey: management.opentelemetry.resource-attributes @@ -55,3 +61,40 @@ recipeList: oldPropertyKey: spring.jms.listener.concurrency newPropertyKey: spring.jms.listener.min-concurrency + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.datasource.dbcp2.default-query-timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.datasource.dbcp2.max-conn-lifetime-millis + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.datasource.dbcp2.max-wait-millis + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.datasource.dbcp2.min-evictable-idle-time-millis + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.datasource.dbcp2.remove-abandoned-timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.datasource.dbcp2.soft-min-evictable-idle-time-millis + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.datasource.dbcp2.time-between-eviction-runs-millis + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.datasource.dbcp2.validation-query-timeout + comment: "This property is deprecated and will be removed in future Spring Boot versions" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.influx.password + comment: "This property is deprecated: the new InfluxDb Java client provides Spring Boot integration" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.influx.url + comment: "This property is deprecated: the new InfluxDb Java client provides Spring Boot integration" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.influx.user + comment: "This property is deprecated: the new InfluxDb Java client provides Spring Boot integration" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.mvc.throw-exception-if-no-handler-found + comment: "This property is deprecated: DispatcherServlet property is deprecated for removal and should no longer need to be configured" + diff --git a/src/main/resources/META-INF/rewrite/spring-boot-33-properties.yml b/src/main/resources/META-INF/rewrite/spring-boot-33-properties.yml index 441e4c371..166b75f2a 100644 --- a/src/main/resources/META-INF/rewrite/spring-boot-33-properties.yml +++ b/src/main/resources/META-INF/rewrite/spring-boot-33-properties.yml @@ -30,4 +30,17 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: spring.couchbase.env.ssl.key-store-password newPropertyKey: spring.couchbase.env.ssl.bundle + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: spring.kafka.streams.cache-max-bytes-buffering + newPropertyKey: spring.kafka.streams.state-store-cache-max-size + + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: management.prometheus.metrics.export.histogram-flavor + comment: "This property is deprecated: No longer supported. Works only when using the Prometheus simpleclient." + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.flyway.cherry-pick + comment: "This property is deprecated: Removed in Flyway 10" + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: spring.flyway.license-key + comment: "This property is deprecated: Removed in Flyway 10" diff --git a/src/main/resources/META-INF/rewrite/spring-boot-34-properties.yml b/src/main/resources/META-INF/rewrite/spring-boot-34-properties.yml deleted file mode 100644 index 5af7958f0..000000000 --- a/src/main/resources/META-INF/rewrite/spring-boot-34-properties.yml +++ /dev/null @@ -1,120 +0,0 @@ -# -# Copyright 2024 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. -# -# This file is automatically generated by the GeneratePropertiesMigratorConfiguration class. -# Do not edit this file manually. Update the Spring Boot property metadata upstream instead. ---- -type: specs.openrewrite.org/v1beta/recipe -name: org.openrewrite.java.spring.boot3.SpringBootProperties_3_4 -displayName: Migrate Spring Boot properties to 3.4 -description: Migrate properties found in `application.properties` and `application.yml`. -tags: - - spring - - boot -recipeList: - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.auditevents.enabled - newPropertyKey: management.endpoint.auditevents.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.beans.enabled - newPropertyKey: management.endpoint.beans.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.caches.enabled - newPropertyKey: management.endpoint.caches.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.conditions.enabled - newPropertyKey: management.endpoint.conditions.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.configprops.enabled - newPropertyKey: management.endpoint.configprops.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.env.enabled - newPropertyKey: management.endpoint.env.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.flyway.enabled - newPropertyKey: management.endpoint.flyway.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.health.enabled - newPropertyKey: management.endpoint.health.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.heapdump.enabled - newPropertyKey: management.endpoint.heapdump.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.httpexchanges.enabled - newPropertyKey: management.endpoint.httpexchanges.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.info.enabled - newPropertyKey: management.endpoint.info.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.integrationgraph.enabled - newPropertyKey: management.endpoint.integrationgraph.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.liquibase.enabled - newPropertyKey: management.endpoint.liquibase.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.logfile.enabled - newPropertyKey: management.endpoint.logfile.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.loggers.enabled - newPropertyKey: management.endpoint.loggers.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.mappings.enabled - newPropertyKey: management.endpoint.mappings.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.metrics.enabled - newPropertyKey: management.endpoint.metrics.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.prometheus.enabled - newPropertyKey: management.endpoint.prometheus.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.quartz.enabled - newPropertyKey: management.endpoint.quartz.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.sbom.enabled - newPropertyKey: management.endpoint.sbom.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.scheduledtasks.enabled - newPropertyKey: management.endpoint.scheduledtasks.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.sessions.enabled - newPropertyKey: management.endpoint.sessions.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.shutdown.enabled - newPropertyKey: management.endpoint.shutdown.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.startup.enabled - newPropertyKey: management.endpoint.startup.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoint.threaddump.enabled - newPropertyKey: management.endpoint.threaddump.access - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: management.endpoints.enabled-by-default - newPropertyKey: management.endpoints.access.default - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.gson.lenient - newPropertyKey: spring.gson.strictness - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.kafka.retry.topic.delay - newPropertyKey: spring.kafka.retry.topic.backoff.delay - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.kafka.retry.topic.max-delay - newPropertyKey: spring.kafka.retry.topic.backoff.maxDelay - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.kafka.retry.topic.multiplier - newPropertyKey: spring.kafka.retry.topic.backoff.multiplier - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: spring.kafka.retry.topic.random-back-off - newPropertyKey: spring.kafka.retry.topic.backoff.random - diff --git a/src/test/java/org/openrewrite/java/spring/ChangeSpringPropertyValueTest.java b/src/test/java/org/openrewrite/java/spring/ChangeSpringPropertyValueTest.java index 60a2ec42a..299d6cc3d 100644 --- a/src/test/java/org/openrewrite/java/spring/ChangeSpringPropertyValueTest.java +++ b/src/test/java/org/openrewrite/java/spring/ChangeSpringPropertyValueTest.java @@ -27,7 +27,7 @@ class ChangeSpringPropertyValueTest implements RewriteTest { @Test void propFile() { rewriteRun( - spec -> spec.recipe(new ChangeSpringPropertyValue("server.port", "8081", null, null, null)), + spec -> spec.recipe(new ChangeSpringPropertyValue("server.port", "8081", null, null, null)), properties("server.port=8080", "server.port=8081") ); } @@ -35,7 +35,7 @@ void propFile() { @Test void yamlDotSeparated() { rewriteRun( - spec -> spec.recipe(new ChangeSpringPropertyValue("server.port", "8081", null, null, null)), + spec -> spec.recipe(new ChangeSpringPropertyValue("server.port", "8081", null, null, null)), yaml("server.port: 8080", "server.port: 8081") ); } @@ -43,7 +43,7 @@ void yamlDotSeparated() { @Test void yamlIndented() { rewriteRun( - spec -> spec.recipe(new ChangeSpringPropertyValue("server.port", "8081", null, null, null)), + spec -> spec.recipe(new ChangeSpringPropertyValue("server.port", "8081", null, null, null)), yaml("server:\n port: 8080", "server:\n port: 8081") ); } @@ -51,7 +51,7 @@ void yamlIndented() { @Test void regex() { rewriteRun( - spec -> spec.recipe(new ChangeSpringPropertyValue("server.port", "80$1", "^([0-9]{2})$", true, null)), + spec -> spec.recipe(new ChangeSpringPropertyValue("server.port", "80$1", "^([0-9]{2})$", true, null)), properties("server.port=53", "server.port=8053"), yaml("server.port: 53", "server.port: 8053") ); diff --git a/src/test/java/org/openrewrite/java/spring/CommentOutSpringPropertyKeyTest.java b/src/test/java/org/openrewrite/java/spring/CommentOutSpringPropertyKeyTest.java new file mode 100644 index 000000000..3d8782c50 --- /dev/null +++ b/src/test/java/org/openrewrite/java/spring/CommentOutSpringPropertyKeyTest.java @@ -0,0 +1,111 @@ +/* + * 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. + */ +package org.openrewrite.java.spring; + +import org.junit.jupiter.api.Test; +import org.openrewrite.DocumentExample; +import org.openrewrite.properties.tree.Properties; +import org.openrewrite.test.RewriteTest; +import org.openrewrite.yaml.tree.Yaml; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.openrewrite.properties.Assertions.properties; +import static org.openrewrite.yaml.Assertions.yaml; + +class CommentOutSpringPropertyKeyTest implements RewriteTest { + + @DocumentExample + @Test + void yamlComment() { + rewriteRun( + spec -> spec.recipe(new CommentOutSpringPropertyKey("server.port", "This property has been removed.")), + //language=yaml + yaml( + "server.port: 8080", + """ + # This property has been removed. + # server.port: 8080 + """) + ); + } + + @Test + void shouldInsertInlineCommentsIntoProperties() { + rewriteRun( + spec -> spec.recipes( + new CommentOutSpringPropertyKey("test.propertyKey1", "my comment 1"), + new CommentOutSpringPropertyKey("test.propertyKey2", "my comment 2") + ), + //language=yaml + yaml( + """ + test: + propertyKey1: xxx + propertyKey2: yyy + propertyKey3: zzz + """, + """ + test: + # my comment 2 + # my comment 1 + # propertyKey1: xxx + # propertyKey2: yyy + propertyKey3: zzz + """, + spec -> spec.path("application.yaml") + .afterRecipe(file -> + assertThat( + ((Yaml.Mapping) + ((Yaml.Mapping) file.getDocuments().get(0) + .getBlock()).getEntries().get(0) + .getValue()).getEntries().get(0) + .getPrefix()) + .isEqualTo( + """ + + # my comment 2 + # my comment 1 + # propertyKey1: xxx + # propertyKey2: yyy + \ + """ + ) + ) + ), + //language=properties + properties( + """ + test.propertyKey1=xxx + test.propertyKey2=yyy + test.propertyKey3=zzz + """, + """ + test.propertyKey1=xxx # my comment 1 + test.propertyKey2=yyy # my comment 2 + test.propertyKey3=zzz + """, + spec -> spec.path("application.properties") + .afterRecipe(file -> + // XXX Right now trailing comments are mapped as part of the value, not as separate comments + assertThat( + ((Properties.Entry) file.getContent().get(1)) + .getValue().getText()) + .isEqualTo("yyy # my comment 2") + ) + ) + ); + } +} diff --git a/src/test/java/org/openrewrite/java/spring/internal/GeneratePropertiesMigratorConfiguration.java b/src/test/java/org/openrewrite/java/spring/internal/GeneratePropertiesMigratorConfiguration.java index c55089caf..e23770be4 100644 --- a/src/test/java/org/openrewrite/java/spring/internal/GeneratePropertiesMigratorConfiguration.java +++ b/src/test/java/org/openrewrite/java/spring/internal/GeneratePropertiesMigratorConfiguration.java @@ -18,15 +18,15 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import io.github.classgraph.ClassGraph; +import io.github.classgraph.ResourceList; import io.github.classgraph.ScanResult; import org.jspecify.annotations.Nullable; import org.openrewrite.maven.tree.Version; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UncheckedIOException; +import java.io.*; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.time.LocalDate; @@ -39,12 +39,12 @@ import static java.util.stream.Collectors.toSet; class GeneratePropertiesMigratorConfiguration { + private static final ObjectMapper objectMapper = new ObjectMapper().disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + private static final String DEPRECATION_PREFIX = "This property is deprecated: "; + private static final String DEFAULT_DEPRECATION_COMMENT = "This property is deprecated and will be removed in future Spring Boot versions"; + public static void main(String[] args) throws IOException { var springBootReleases = new SpringBootReleases(true); // `true` for release candidates - - var objectMapper = new ObjectMapper() - .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - var releasesDir = new File(".boot-releases"); //noinspection ResultOfMethodCallIgnored releasesDir.mkdirs(); @@ -59,7 +59,7 @@ public static void main(String[] args) throws IOException { for (String version : latestPatchReleases) { Version semanticVersion = new Version(version); // We only need to scan one outdated version to prevent duplicate migration recipes - if (semanticVersion.compareTo(new Version("3.0")) < 0) { + if (semanticVersion.compareTo(new Version("3.1")) < 0) { continue; } var versionDir = new File(releasesDir, version); @@ -67,8 +67,8 @@ public static void main(String[] args) throws IOException { System.out.println("Downloading version " + version); springBootReleases.download(version).forEach(download -> { try { - Files.write(versionDir.toPath().resolve(download.getModuleName() + "-" + - version + ".jar"), download.getBody()); + Files.write(versionDir.toPath().resolve( + download.getModuleName() + "-" + version + ".jar"), download.getBody()); } catch (IOException e) { throw new UncheckedIOException(e); } @@ -78,74 +78,123 @@ public static void main(String[] args) throws IOException { } System.out.println("Scanning version " + version); + var deprecations = getDeprecations(versionDir, alreadyDefined); + if (deprecations.isEmpty()) { + continue; + } + var majorMinor = version.split("\\."); + if (semanticVersion.compareTo(new Version("3.2")) < 0) { + // Don't override manual fixes to the unsupported 2.x and 3.0 versions anymore + continue; + } + var recipePath = Paths.get("src/main/resources/META-INF/rewrite/spring-boot-%s%s-properties.yml".formatted(majorMinor[0], majorMinor[1])); + writeFileHeader(majorMinor, recipePath); + generateReplacementRecipes(deprecations, recipePath); + generateCommentRecipesForDeprecations(deprecations, recipePath); + } + } - try (ScanResult scanResult = new ClassGraph() - .overrideClasspath(Arrays.stream(requireNonNull(versionDir.listFiles())).map(File::toURI).collect(Collectors.toList())) - .acceptPaths("META-INF") - .enableMemoryMapping() - .scan()) { - var replacements = scanResult.getResourcesMatchingWildcard("**/*spring-configuration-metadata.json").stream() - .flatMap(res -> { - try (InputStream inputStream = res.open()) { - var metadata = objectMapper.readValue(inputStream, SpringConfigurationMetadata.class); - return metadata.properties().stream() - .filter(p -> p.deprecation() != null && p.deprecation().replacement() != null); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - }) - .filter(p -> alreadyDefined.add(p.name())) - .sorted(Comparator.comparing(SpringConfigurationMetadata.ConfigurationProperty::name)) - .toList(); - - if (!replacements.isEmpty()) { - var majorMinor = version.split("\\."); - if (semanticVersion.compareTo(new Version("3.1")) < 0) { - // Don't override manual fixes to the unsupported 2.x and 3.0 versions anymore - continue; - } + private static List getDeprecations(File versionDir, Set alreadyDefined) { + try (ScanResult scanResult = new ClassGraph() + .overrideClasspath(Arrays.stream(requireNonNull(versionDir.listFiles())).map(File::toURI).collect(Collectors.toList())) + .acceptPaths("META-INF") + .enableMemoryMapping() + .scan()) { + ResourceList resources = scanResult.getResourcesMatchingWildcard("**/*spring-configuration-metadata.json"); + return resources.stream() + .flatMap(res -> { + try (InputStream inputStream = res.open()) { + final String text = new BufferedReader( + new InputStreamReader(inputStream, StandardCharsets.UTF_8)) + .lines() + .collect(joining("\n")); + InputStream inputStream2 = new ByteArrayInputStream(text.getBytes(StandardCharsets.UTF_8)); + var metadata = objectMapper.readValue(inputStream2, SpringConfigurationMetadata.class); + return metadata.properties().stream() + .filter(p -> p.deprecation() != null) + .filter(p -> alreadyDefined.add(getPropertyKey(p))); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }) + .toList(); + } + } - var config = Paths.get("src/main/resources/META-INF/rewrite/spring-boot-%s%s-properties.yml".formatted(majorMinor[0], majorMinor[1])); - Files.writeString(config, "#\n" + - Files.readAllLines(Paths.get("gradle/licenseHeader.txt")) - .stream() - .map(str -> str.replaceAll("^", "# ")) - .map(str -> str.replace("${year}", LocalDate.now().getYear() + "")) - .collect(Collectors.joining("\n")) + "\n#\n"); - - Files.writeString(config, """ - # This file is automatically generated by the GeneratePropertiesMigratorConfiguration class. - # Do not edit this file manually. Update the Spring Boot property metadata upstream instead. - --- - type: specs.openrewrite.org/v1beta/recipe - name: org.openrewrite.java.spring.boot%1$s.SpringBootProperties_%1$s_%2$s - displayName: Migrate Spring Boot properties to %1$s.%2$s - description: Migrate properties found in `application.properties` and `application.yml`. - tags: - - spring - - boot - recipeList:""".formatted(majorMinor[0], majorMinor[1]), - StandardOpenOption.APPEND); - - Files.writeString(config, replacements.stream() - .map(r -> """ - - org.openrewrite.java.spring.ChangeSpringPropertyKey: - oldPropertyKey: %s - newPropertyKey: %s - """.formatted( - r.name(), requireNonNull(r.deprecation()).replacement()) - ) - .collect(joining("", "\n", "\n")), - StandardOpenOption.APPEND); - } - } + private static void generateReplacementRecipes(List properties, Path recipePath) throws IOException { + var replacements = properties.stream() + .filter(d -> (d.deprecation() != null) && d.deprecation().replacement() != null) + .sorted(Comparator.comparing(SpringConfigurationMetadata.ConfigurationProperty::name)) + .toList(); + + if (!replacements.isEmpty()) { + Files.writeString(recipePath, replacements.stream() + .map(r -> """ + - org.openrewrite.java.spring.ChangeSpringPropertyKey: + oldPropertyKey: %s + newPropertyKey: %s + """.formatted( + r.name(), requireNonNull(r.deprecation()).replacement()) + ) + .collect(joining("", "\n", "\n")), + StandardOpenOption.APPEND); + } + } + + private static void generateCommentRecipesForDeprecations(List properties, Path recipePath) throws IOException { + var deprecationsWithoutReplacement = properties.stream() + .filter(d -> (d.deprecation() != null) && d.deprecation().replacement() == null) + .sorted(Comparator.comparing(SpringConfigurationMetadata.ConfigurationProperty::name)) + .toList(); + + if (!deprecationsWithoutReplacement.isEmpty()) { + Files.writeString(recipePath, deprecationsWithoutReplacement.stream() + .map(r -> """ + - org.openrewrite.java.spring.CommentOutSpringPropertyKey: + propertyKey: %s + comment: "%s" + """.formatted(r.name(), r.deprecation().reason() != null ? + DEPRECATION_PREFIX + r.deprecation().reason() : DEFAULT_DEPRECATION_COMMENT)) + .collect(joining("", "", "\n")), + StandardOpenOption.APPEND); } } + + private static String getPropertyKey(SpringConfigurationMetadata.ConfigurationProperty property) { + String replacementSuffix = (property.deprecation() != null) && + (property.deprecation().replacement() != null) ? + "->" + property.deprecation().replacement() : ""; + return property.name() + replacementSuffix; + } + + private static void writeFileHeader(String[] majorMinor, Path recipePath) throws IOException { + Files.writeString(recipePath, + "#\n" + + Files.readAllLines(Paths.get("gradle/licenseHeader.txt")) + .stream() + .map(str -> str.replaceAll("^", "# ")) + .map(str -> str.replace("${year}", LocalDate.now().getYear() + "")) + .collect(Collectors.joining("\n")) + "\n#\n"); + + Files.writeString(recipePath, """ + # This file is automatically generated by the GeneratePropertiesMigratorConfiguration class. + # Do not edit this file manually. Update the Spring Boot property metadata upstream instead. + --- + type: specs.openrewrite.org/v1beta/recipe + name: org.openrewrite.java.spring.boot%1$s.SpringBootProperties_%1$s_%2$s + displayName: Migrate Spring Boot properties to %1$s.%2$s + description: Migrate properties found in `application.properties` and `application.yml`. + tags: + - spring + - boot + recipeList:""".formatted(majorMinor[0], majorMinor[1]), + StandardOpenOption.APPEND); + } } record SpringConfigurationMetadata(List properties) { record ConfigurationProperty(String name, @Nullable Deprecation deprecation) { - record Deprecation(@Nullable String replacement) { + record Deprecation(@Nullable String replacement, @Nullable String reason) { } } }