Closed
Description
Affects: 6.0.11
When I compose my own annotations which all use @ComponentScan
and I use those annotations on an application class, only the first one is used:
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
@ComponentScan(basePackageClasses = ModuleAClient.class)
public @interface ConnectedToModuleA {
}
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
@ComponentScan(basePackageClasses = ModuleBClient.class)
public @interface ConnectedToModuleB {
}
@ConnectedToModuleA // Only the ComponentScan from this annotation is picked
@ConnectedToModuleB // ComponentScan from this annotation is ignored
public class MyApplication {
public static void main(String[] args) {
SpringApplication.run(MyApplication.class, args);
}
}