I have problem with Spring Boot configuration.
I have created base Spring Boot project using https://start.spring.io/
And I have a problem, configuration works only for classes in sub catalog:
I have tried annotation @ComponentScan but it didn't help.
Do You have any idea what can I do with this?
Many Spring Boot developers always have their main class annotated with
@ComponentScan. Since these annotations are so frequently used together (especially if you follow the best practices above), Spring Boot provides a convenient
@SpringBootApplicationannotation is equivalent to using
@ComponentScanwith their default attributes: [...]
@ComponentScan javadoc states
If specific packages are not defined, scanning will occur from the package of the class that declares this annotation.
That is, only the types that are in the same package as your
ReadingListApplication will be scanned.
If you want a custom configuration, provide your own
@ComponentScan, as appropriate.