Fork me on GitHub

若依新增模块

新建业务模块

选择父目录->新建->新模块->maven模块->输入名字->创建完成子模块
image

1.集成核心坐标

创建完成子模块第一步:将(创建的business模块)子模块继承framework核心依赖


<!-- 继承父模块公共配置-->
<parent>
    <groupId>com.ruoyi</groupId>
    <artifactId>ruoyi</artifactId>
    <version>3.9.0</version>
</parent>

<!-- 声明坐标及版本号-->
<groupId>com.business</groupId>
<artifactId>ruoyi-business</artifactId>
<version>1.0.0</version>

<!-- 核心模块-->
<dependency>
    <groupId>com.ruoyi</groupId>
    <artifactId>ruoyi-framework</artifactId>
</dependency>

image

2.顶级父模块(ruoyi-vue)中引入子模块的坐标

    <!-- 父模块用来 统一管理依赖版本、控制依赖范围 -->
    <dependencyManagement>
        <dependencies>
            <!--业务模块,顶级父模块统一管理版本号,这样继承父模块的自模块可以不写版本号-->
            <dependency>
                <groupId>com.business</groupId>
                <artifactId>ruoyi-business</artifactId>
                <version>1.0.0</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

image

3.启动类模块(ruoyi-admin)引入子模块

            <!--业务模块,不写版本号,因为顶级模块已经写了,直接继承-->
            <dependency>
                <groupId>com.business</groupId>
                <artifactId>ruoyi-business</artifactId>
            </dependency>

image

posted @ 2025-07-01 21:26  秋夜雨巷  阅读(470)  评论(0)    收藏  举报