rewrite-spring icon indicating copy to clipboard operation
rewrite-spring copied to clipboard

Support upgrades for Spring Cloud Stream

Open seachicken opened this issue 11 months ago • 3 comments

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 https://github.com/openrewrite/rewrite/discussions/4976

seachicken avatar Jan 31 '25 18:01 seachicken

hi @seachicken ! Any help developing Spring Cloud Stream related recipes would be much appreciated! Feel free to start with a draft pull request containing a couple of tests of the migrations you'd like to see, and then we'll figure out the next steps from there.

timtebeek avatar Feb 03 '25 15:02 timtebeek

Hi @timtebeek,

Can I pick up this ticket on writing recipes for the spring cloud stream upgrade?

Thanks, Mahi

bsmahi avatar Mar 27 '25 02:03 bsmahi

Can I pick up this ticket on writing recipes for the spring cloud stream upgrade?

Absolutely, thanks for the offer to help!

timtebeek avatar Mar 27 '25 08:03 timtebeek