Let’s assume I have two Spring boot projects. The first project is just a supporting library providing various functionalities. The second is the “main” project (primary library) which uses the supporting project (jar).
The supporting library has some services which should be autowired by the primary project.
How can I configure the supporting library so that the primary library does not have to do any configurations for the supporting library. In essence I am talking about component scan.
What I have read so far is, that the primary library has to include the packages of the supporting library in component scan. Is this really true? I hope not, because in my opinion a supporting library should do all its configurations by its own and another library (or project) just using this supporting library should not have to deal with the configuration of the supporting library.
In essence I am wondering if it is possible that a supporting library configures itself via a @Configuration
annotation or that like (or @SpringBootApplication
) so that another library does not have to deal with all that details of the other library. I really hope that this does work somehow because I think it is kind of extremely wired that another library has to do the job for it’s supporting library in regard of their configuration.