我使用spring组件扫描来自动检测bean:
@ComponentScan({"com.org.x, com.org.y"})
问题是我想要com.org.x扫描所有类,但我想要一个单独的类com.org.y.SomeService.class,单独扫描com.org.y
com.org.x
com.org.y.SomeService.class
com.org.y
我怎样才能做到这一点?
除了使用上下文扫描之外,我如何创建这个bean并注入应用程序上下文?
java spring spring-annotations spring-boot component-scan
component-scan ×1
java ×1
spring ×1
spring-annotations ×1
spring-boot ×1