maven springboot 模块共享

1.项目整个目录

maven springboot 模块共享

2.将每个模块的名字配置文件名称修改(以dirver模块为例)

maven springboot 模块共享

并在application-drivier配置文件中写入

spring:
  profiles: driver

 

我是以core作为中心模块的  所以要在pom文件中添加依赖

<dependency>
    <groupId>com.hanhuide</groupId>
    <artifactId>driver</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>com.hanhuide</groupId>
    <artifactId>toolkit</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <scope>compile</scope>
</dependency>

并在配置文件中添加(各个模块之间逗号隔开)

spring:
  profiles:
    include: driver,toolkit

 

完事!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!