Skip to content

Support upgrades for Spring Cloud Stream #672

@seachicken

Description

@seachicken

Hello, thanks for the fascinating tool! I ran the upgrade recipe to boot 2.7 on the below project using Maven CLI, but the application ran into an error when running because spring-cloud-stream-dependencies was not upgraded.

My Environment

  • Maven 3.9.9
  • OpenJDK 1.8.0_362
  • Spring Boot 1.5.2

Run:

mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
            -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:LATEST \
            -Drewrite.activeRecipes=org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7

Error occurred on runtime:

2025-01-31 17:49:39.771 ERROR 64501 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.IllegalArgumentException: Could not find class [org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration]
	at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:341) ~[spring-core-5.3.31.jar:5.3.31]
	at org.springframework.core.annotation.TypeMappedAnnotation.adapt(TypeMappedAnnotation.java:474) ~[spring-core-5.3.31.jar:5.3.31]
	at org.springframework.core.annotation.TypeMappedAnnotation.getValue(TypeMappedAnnotation.java:397) ~[spring-core-5.3.31.jar:5.3.31]
	at org.springframework.core.annotation.TypeMappedAnnotation.asMap(TypeMappedAnnotation.java:283) ~[spring-core-5.3.31.jar:5.3.31]
	at org.springframework.core.annotation.AbstractMergedAnnotation.asAnnotationAttributes(AbstractMergedAnnotation.java:193) ~[spring-core-5.3.31.jar:5.3.31]
	at org.springframework.core.type.AnnotatedTypeMetadata.getAnnotationAttributes(AnnotatedTypeMetadata.java:106) ~[spring-core-5.3.31.jar:5.3.31]
	at org.springframework.core.type.AnnotatedTypeMetadata.getAnnotationAttributes(AnnotatedTypeMetadata.java:81) ~[spring-core-5.3.31.jar:5.3.31]
	at org.springframework.context.annotation.AnnotationConfigUtils.attributesFor(AnnotationConfigUtils.java:285) ~[spring-context-5.3.31.jar:5.3.31]
	at org.springframework.context.annotation.AnnotationBeanNameGenerator.determineBeanNameFromAnnotation(AnnotationBeanNameGenerator.java:103) ~[spring-context-5.3.31.jar:5.3.31]
...

I read the OpenRewrite documentation but could not find a page for Spring Cloud Stream, so do you have plans to support upgrading Spring Cloud Stream? Or can I contribute by adding a recipe to rewrite-spring?

Originally posted by @seachicken in openrewrite/rewrite#4976

Metadata

Metadata

Assignees

No one assigned

    Labels

    recipeRecipe requested

    Projects

    Status

    Recipes Wanted

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions