Spring boot project has introduced a two-party package. Every time a class An in the two-party package is used, new A (), An itself is a normal class in the two-party package. There is no @ Component and other notes related to spring. If you want to annotate bean, in the spring boot project, how to inject it? please use A
as follows.@Componet
private A a;
uses the following comments, adding @ ComponentScan to the startup app class, adding the path to the third-party package or reporting an error
@Configurable
public class Util{
@Bean
public A getA(){
return new A();
}
}