I want to add a new annotation based stereotype like @Service, into my starter project, but i don't know how to handle the registration process of that bean.
I found a solution loike
final ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
provider.addIncludeFilter(new AnnotationTypeFilter(MyCustomAnnotation.class));
for (BeanDefinition entry : provider.findCandidateComponents("my.package.name")) {
...
/* register the Bean into the Spring Context */
...
}
But I don't want a hard coded "package-path", cuz I don't know the Package the starter is used in.
Is there a solution for my problem?
Thx a lot!