We are building a Spring-based Java library that has several @Autowired assignments, which pick up @Bean instances from the library path, detected at runtime.
That works great when we test the application directly (with an @SpringBootApplication in the library)
However when we include the library as a dependency in other projects, it does not do the component scan of the library classes, and so the @Autowired injections never happen.
Of course we could tell the application developers to add the library path to their component scan, but that would lead to questions, errors, and frustration.
How can we tell Spring to do a component scan of the library classes, without explicitly including the scan base in the consumer applications?