I have a class (say Class A) that @Autowire
a properties class (Class B). B's fields are read from application.yml
and then a bean is created using @Component
. This bean can then be used in class A using @Autowire
.
When I run the application in the same module, all the beans are created fine and the application runs. But when I do a @Import(A.class)
from a @Configuration
class of another module (it's a multi-module project), the bean
created for Class B contains all null
values. This means that it is not reading the application.yml
in it's module.
What can be the reason behind such behaviour?