I\'m maintaining a project with two set of main packages, the project is using Spring and Spring MVC, one of these packages contains several controllers and is scanned using
What @Bart said for XML.
If you need to pull in that one class using annotations, add the following to one of your @Configuration classes
@ComponentScan(
basePackageClasses = YourClass.class,
useDefaultFilters = false,
includeFilters = {
@ComponentScan.Filter(type = ASSIGNABLE_TYPE, value = YourClass.class)
})