I made a jar with Spring components to include in multiple projects (core.jar).
I created a new Spring project, have @ComponentScan to the correct package, but it i
Give it the appropriate package name to scan in the JAR.
@ComponentScan(basePackages = {"com.example.from.jar"})
I had a similar issue with Spring boot and @ComponentScan and this document helped me solving the issue: http://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-structuring-your-code.html.
The point was that my @SpringBootApplication class was in the root package of one of basePackages of @ComponentScan. After I moved it to a subpackage, Spring was able to recognize all @ComponentScans.