结构图:
步骤:
1、在需要扫描的类中添加注解@Configuration,例如:
2、在service模块pom.xml中配置service_base依赖,artifactId中是模块名
<dependency> <groupId>com.feng</groupId> <artifactId>service_base</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency>
3、在EduApplication类中配置扫描路径
结果(我是用swagger时使用的),成功打开service_base模块下的文件: