The @SpringBootApplication
annotation (or, more precisely the inferred @ComponentScan
annotation) by default only scans the classpath next to and below the annotated class.
So, your configuration class must be placed next to or in a sub package of you Application class.