In my project there\'s a common base class that all client classes extend. This has an @Autowired field that needs to be injected by Hibernate. These are all grouped together in
I've dealt with this issue by creating my own annotation (heritable) and then customizing classpath scanning:
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Component
@Inherited
public @interface BusinessService {
}
Spring configuration look likes this:
from Spring doc 5.10.3 Using filters to customize scanning