openrewrite / openrewrite/rewrite-spring
Add recipe to migrate projects from Spring Framework to using Spring Boot
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 403
- Forks
- 149
- Avg merge
- 2h 33m
- Merged PRs (30d)
- 10
Description
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.e org.springframework.spring-core, org.springframework.spring-web,...)
Describe the situation before applying the recipe
org.springframeworkdependenciesbeans.xml
Describe the situation after applying the recipe
org.springframework.bootdependenciesapplication.ymland@Configurationfiles
A list of steps with links to documentation
Roughly based upon outline in https://www.baeldung.com/spring-boot-migration
- Replace explicit Spring Framework dependencies with corresponding Spring Boot starter dependencies
- Change packaging from war to jar
- Add embedded web server dependency
- Replace simple
<bean>s with annotations on corresponding classes - Add a
@SpringBootApplicationannotated main Application class - Add
@ImportResource("applicationContext.xml")for remaining xml configuration - Migrate resource files to standardized paths, or customize
spring.resources.static-locationsproperty - Remove explicit
WebApplicationInitializerand@EnableWebMvcclasses - ...
Have 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the migration checklist in the issue and its linked Baeldung outline, then examine the requested changes to org.springframework dependencies, beans.xml, applicationContext.xml, application.yml, packaging, and configuration classes. Done means the recipe covers an agreed subset or all of the listed Spring Framework-to-Spring Boot transformations; the issue does not name tests or existing entry points.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- backend, build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100