Where do I put my XML beans in a Spring Boot application?

As long as you’re starting with a base @Configuration class to begin with, which it maybe sounds like you are with @SpringBootApplication, you can use the @ImportResource annotation to include an XML configuration file as well.

@SpringBootApplication
@ImportResource("classpath:spring-sftp-config.xml")
public class SpringConfiguration {
  //
}

Leave a Comment