Open FieteO opened 1 month ago
Hi @FieteO ; thanks for the suggestion! It's come up a few times internally as well. Right now I'd say we have a lot of recipes and building blocks that might assist such a migration, but none explicitly that convert towards Spring Boot.
As with other migration recipes we've done in the past I find it works best if we break the task down into smaller steps that can individually be contributed. You've called out dependencies already as a step that would be relatively straightforward with the Add/Change/RemoveDependency
building blocks that we offer. Perhaps there's more we can do to break this down and to offer a start relatively soon, that can then be expanded upon. I find a GitHub task list might work best; no immediate need for separate issues; we can pick those up in pull requests.
That's good to hear! Do you need any further input from my side?
You'll probably have a better idea of what makes up a current Spring Framework application, and what steps you see when you migrate one to Spring Boot. If you could help document the steps needed that would be great.
I will see what I can do. Though I actually have no history of working with a springframework based service, it's just inherited. You suggested to document steps in a GitHub task list. Could you provide some link for that, since I have not worked with them yet...
Sure; I've updated your post above to include a start to such a list; we can expand that of course, and cross them off once implemented. Some of them should be fairly straightforward, although it might be hard to do a complete automated migration. I think that's valid enough to have a recipe help you on your way though, so no need to be exhaustive for a one time migration.
What problem are you trying to solve?
I have an old application that is not using spring-boot yet, but rather uses the spring framework. I'd like to migrate it to spring-boot since that is easier to work with and seems more future-proof.
What precondition(s) should be checked before applying this recipe?
That dependencies from the
org.springframework
group are present (i.eorg.springframework.spring-core
,org.springframework.spring-web
,...)Describe the situation before applying the recipe
org.springframework
dependenciesbeans.xml
Describe the situation after applying the recipe
org.springframework.boot
dependenciesapplication.yml
and@Configuration
filesA list of steps with links to documentation
Roughly based upon outline in https://www.baeldung.com/spring-boot-migration
<bean>
s with annotations on corresponding classes@SpringBootApplication
annotated main Application class@ImportResource("applicationContext.xml")
for remaining xml configurationspring.resources.static-locations
propertyWebApplicationInitializer
and@EnableWebMvc
classesHave you considered any alternatives or workarounds?
No
Are you interested in contributing this recipe to OpenRewrite?
Generally yes, but I wouldn't start with such a (likely quite complex) endeavour.