1、在ruoyi-modules
模块点击新建Modules
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-modules</artifactId>
<!-- 此处版本号改为{revision},跟随主版本 -->
<version>{revision}</version>
</parent>
<artifactId>ruoyi-biz</artifactId>
<description>
业务模块
</description>
<dependencies>
<!-- 引入system模块,也可以将system模块的依赖复制过来 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>
</dependencies>
</project>
<!-- 新增的模块包 -->
<module>ruoyi-demo1</module>
<!-- 新增模块 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-demo1</artifactId>
<version>${revision}</version>
</dependency>
<!-- 将新的模块加入到后台管理依赖中 -->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-demo1</artifactId>
</dependency>
如果是两个不同包名的模块 需要修改如下配置:
1. 找到模块ruoyi-admin
里面的配置文件application.yml
修改高亮位置如下:
# MyBatisPlus配置
# https://baomidou.com/config/
mybatis-plus:
# 多包名使用 例如 org.dromara.**.mapper,org.xxx.**.mapper
mapperPackage: org.dromara.**.mapper
# 对应的 XML 文件位置
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 实体扫描,多个package用逗号或者分号分隔
# typeAliasesPackage: org.dromara.**.domain
typeAliasesPackage: org.dromara.**.domain,com.ruoyi.**.domain
DromaraApplication
扫描包路径:/**
* 启动程序
*
* @author ruoyi
*/
@SpringBootApplication(scanBasePackages = {"org.dromara", "com.xxx"}) // 原来的包路径 + 新的包路径
public class DromaraApplication {
public static void main(String[] args) {
SpringApplication application = new SpringApplication(DromaraApplication.class);
application.setApplicationStartup(new BufferingApplicationStartup(2048));
application.run(args);
System.out.println("(♥◠‿◠)ノ゙ RuoYi-Vue-Plus启动成功 ლ(´ڡ`ლ)゙");
}
}
powered by kaifamiao