分模块开发
首先,我们需要创建一个开发模块,例如:ruoyi-outpatient:这是一个模块 第一步:在主模块的pom坐标添加到子模块
这是主模块
这是子模块:添加好坐标之后还需要把子模块的坐标名引入:如<artifactId>ruoyi-outpatient</artifactId>
第二步:在主模块<modules>标签中添加模块标签<module>如:ruoyi-outpatient<module/>
第三步:在主模块依赖声明标签里添加:由于这里代码太长了,不好用图片,所以就用手写了
<!--依赖声明-->
<dependencyManagement>
<!--依赖-->
<dependencies>
<!-- 自定义模块:第三步-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-outpatient</artifactId>
<version>${ruoyi.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
第四步:在ruoyi-admin模块中添加依赖,需要在admin中引入、才会被打包到jar包中
<dependencies>
<!-- 第四步:在admin中引用、才会被打包到jar-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-outpatient</artifactId>
</dependency>
</dependencies>
第五步:这里要在子模块中 如:ruoyi-outpatient添加若依项目需要用到公共模块,所以这里需要引入公共模块,一样的添加依赖
<dependencies>
<!--第五步导入公共模块-->
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
</dependencies>