2022 最新 IntellJ IDEA 的 mall 开发部署文档
版本说明

一、概述
编写目的
由于本系统的文档不够完善,缺少简单的部署流程,使得很多新人,或没有接触这个系统的人,很难简单快捷的实现,快速部署这个系统,同时,能够快速搭建,学习起来的状况,所以,特此撰写此文章,此文章为原创设计,拒绝抄袭,如有转载,请注明出处.
服务器部署
由于笔者是一个开发人员,所以部署主要以开发的部署到本地的情况为主,文章这是范例,实际的问题,还需要自身学习百度功能,和自身对于一门技术的理解,希望大家努力学习,争取自己领悟部署的方法,本文部署主要选取常用的 windows 系统作为主要的部署环境,希望大家提高自身的部署能力.
二、基本构建
构建工具(参考文献,其他版本安装流程基本一样)

三、Git 导入编译器
如图: git ->clone


四、模块描述浅析
文件路径: mall/pom.ml

五、配置文档

application.yml 修改,涉及模块

mysql 修改为本地或者您当前的配置

application-dev.yml 修改,涉及模块

mysql 修改为本地或者您当前的配置

redis 修改为本地或者您当前的配置

generator.properties 修改,涉及模块

mysql 修改为本地或者您当前的配置
六、在 IDEA 中执行 MySQL 的脚本
在本地建立数据库 mall,(不建立,以下步骤操作不了)
右侧栏,找到 DATABASE,选择加号,找到 MYSQL

填写配置信息,测试连接,测试连接的时候可能要下载相关的 jar 包.

找到需要运行的脚本,然后选择 run


填写数据库信息,选择右侧加号,导入刚刚配置的数据库.




打开 DBeaver 检查数据执行成功.

七、启动后台项目
1、IDE 配置
保证 IDE 的 maven 配置为本地的 maven,JDK 为 1.8 以上的在项目对应上,还有编码格式没有问题(这些基础问题没有问题)
File -> setting
File -> Project Struct
File->Settings->Editor ->File Encodings
File->Settings->Build -> Compiler -> Java Compiler
2、Maven 加载打包
点击 maven 这里的刷新

点击 mall 的这三项加载(三个同时选中,然后点击 run 的绿色三角形).

3、其他服务器启动
(1)redis 配置
启动 redis,这里写了这样的脚本,然后把脚本的快捷方式发送到了桌面
找到本地安装 redis 的路径
新建文件 redis_start.bat,写入如下脚本
选择 redis_start.bat 右键,发送快捷方式到桌面,就生成了快捷启动方式

双击 redis_start.bat 启动 redis

(2)rabbit 界面配置
保证 rabbitMQ 启动正常

输入:guest/guest 登陆

找到如图设置用户的位置.

添加一个用户,根据文档这里要添加一个 mall 用户,密码也是 mall


添加一个虚拟路径,选择如图位置


点击用户主页,为用户添加虚拟路径





以上设置对应文档里的 rabbitMQ 配置,不配置会报错.

(3)其他配置
其他部分都可以参考 redis 设置快捷启动方式.

4、模块启动

(1)mall-admin 启动(mysql 和 redis 要提前启动)
项目的启动位置,右键选择 run 执行(只想看前后端,只启动这一个模块就可以)

如图所示为启动成功

(2)mall-search 启动(mysql 和 elasticsearch 要提前启动)
项目的启动位置,右键选择 run 执行

如图所示为启动成功

(3)mall-portal 启动(mysql、redis 和 elasticsearch 要提前启动)
项目的启动位置,右键选择 run 执行

如图所示为启动成功

八、IDEA 前端配置
1、手动加载 vue 配置,运行前端
打开编译器下边的 Terminal,进入 mall-admin-web 路径执行如下命令

建立项目,执行如下命令


2、IDEA 配置,运行前端
找到 IDE 工具栏,就是启动项目的 run 那里

点击下拉框,找到 Eidt Confiuration,选择

选择小加号

选取 npm

设置 npm 页,完成后,点击 apply

run npm ,如图选择 run 或者 debug。

运行成功(如果本地的 npm 安装没问题,就会产生如图的样子)。

九、登陆
以上没有问题,就会自动弹出登陆页面(登陆账户 账户/密码 :admin/扫码)

进入主页

结语
呕心沥血,爆肝一个星期(需要写配置环境的文档,还要反复测试,以便为各位看官老爷提供最好的精品文章),希望点赞,收藏,评论,转发,您的支持就是本博主前进的动力.
版权声明: 本文为 InfoQ 作者【北极的大企鹅】的原创文章。
原文链接:【http://xie.infoq.cn/article/f43f4327fbbd4f7cb4bd27013】。未经作者许可,禁止转载。
评论