There is a chapter dedicated to Converting an existing application to Spring Boot in the Spring Boot reference guide.
Basically you need to add the Spring Boot dependencies and then implement the main entry point like this:
@SpringBootApplication
@ImportResource("classpath:applicationContext.xml")
public class MySpringBootApplication {
public static void main(String[] args) {
SpringApplication.run(MySpringBootApplication.class, args);
}
}
However, this will also trigger Spring Boot's auto-configuration based upon (among other things) available classes and configured beans. You might want to disable certain auto-configurations. To exclude DataSource and Hibernate JPA auto-configuration, use:
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class })
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…