Issue
I have an old Spring MVC (3.1.0.RELEASE) legacy project, and I want to use new annotations like ControllAdvice, MockMvc etc. so, after a lot of search I found that my best approach is to migrate my old project to Spring boot.
What is the best way to accomplish this, could you give me some tips to consider?
Thanks in advance for your answers, nice coding.
Solution
There is no silver bullet migration guide to do it, but maybe https://www.baeldung.com/spring-boot-migration can give you a few tips to ease your task. I would say that there are some key points:
- Strive to use Spring Boot Starters (they bundle all necessary dependencies for a given topic, e.g. security);
- Strive to use the dependencies version defined by Spring Boot parent instead of your own. This guarantees that you will not face issues when manually update dependencies versions that might not be compatible;
- Learn and understand how Autoconfiguration works since it will help you have a better grasp on how Spring Boot works under the hood (and it might help you while debugging some weird behaviour).
Answered By - João Dias
Answer Checked By - Katrina (JavaFixing Volunteer)