← All recipes
Moderne licensed

Migrate from standalone Spring gRPC 1.0 to Spring Boot 4.1 (Spring gRPC 1.1)

Recipe IDio.moderne.java.spring.boot4.MigrateSpringGrpc_1_1
Artifactio.moderne.recipe:rewrite-spring

Migrate applications from the standalone Spring gRPC project (org.springframework.grpc:*, Spring gRPC 1.0) to the version bundled with Spring Boot 4.1 (Spring gRPC 1.1). Spring gRPC graduated into Spring Boot in 4.1, so its starters, BOM, configuration properties, and test annotations move under org.springframework.boot. Following the Spring gRPC 1.1 Migration Guide, this recipe swaps the org.springframework.grpc starters for the Spring Boot spring-boot-starter-grpc-* starters (splitting the combined runtime and test starters) and removes the standalone spring-grpc-dependencies BOM; renames the spring.grpc.server.* and per-channel spring.grpc.client.channels.<name>.* properties that changed in 1.1 and splits spring.grpc.server.address: host:port into separate address and port; renames the @AutoConfigureInProcessTransport and @LocalGrpcPort test annotations; and, because 1.1 no longer auto-scans generated proto stubs, flags classes that inject gRPC client stubs with a TODO so an explicit @ImportGrpcClients annotation can be added by hand. Not automated: pinning the reactor-grpc-stub version. Spring gRPC 1.1 no longer manages it, so a version-less declaration must be given an explicit version once the standalone BOM is removed (Spring gRPC 1.0 managed 1.2.4).

Composite recipespringbootgrpcProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe io.moderne.java.spring.boot4.MigrateSpringGrpc_1_1

If the recipe isn’t available locally, install it with:

mod config recipes jar install io.moderne.recipe:rewrite-spring:0.39.0

Definition

This recipe runs the following recipes in order.

Data tables

Structured output this recipe can produce.

  • Source files that had resultsSource files that were modified by the recipe run.org.openrewrite.table.SourcesFileResults
  • Source files that had search resultsSearch results that were found during the recipe run.org.openrewrite.table.SearchResults
  • Source files that errored on a recipeThe details of all errors produced by a recipe run.org.openrewrite.table.SourcesFileErrors
  • Recipe performanceStatistics used in analyzing the performance of recipes.org.openrewrite.table.RecipeRunStats