spring-context-indexe
说明
1,虽然类路径扫描非常快,但是Spring内部存在大量的类,添加此依赖,可以通过在编译时创建候选对象的静态列表来提高大型应用程序的启动性能。
2,但是在此模式下,作为组件扫描目标的所有模块都必须使用此机制。才可以。
3,需要spring5以上才能使用,亲测有效
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-indexer</artifactId>
<version>5.2.0.RELEASE</version>
<optional>true</optional>
</dependency>