SpringBoot (xxi) _ using xml

springboot use xml

Although springboot not promote the use of xml, but we may also be used

The sample code

1. Create a profile in resources, as shown in FIG.

2. Set configuration class

@Configuration
@ImportResource("classpath:elasticjob/*.xml")
public class JobConfig {
}

Attention to the problem

I created a new folder here, if you create a new xml file directly,
direct write@ImportResource("xx.xml")

Well, have fun

Guess you like

Origin www.cnblogs.com/zhenghengbin/p/11544579.html