前置环境,安装jdk,idea,maven环境
第一步:
在idea中新建一个maven项目
这里面我假定做一个学生管理系统,叫做studentmanage的系统:
这里面我默认选择的jdk是11
第二步:
开始添加各子模块:
在这里面我需要做几个模块,分别为studentmanage-task,studentmanage-rpc,studentmanage-mq,studentmanage-web.
基本的maven结构创建完毕。
第三步:
编辑根pom文件:
接下来开始编辑父pom文件。
org.springframework.boot spring-boot-starter-parent2.3.9.RELEASE 11 UTF-8 UTF-8
spring-boot-starter-parent
这一句,点开里面的内容,可以看到这里面定义了依赖的版本,所以后续相关依赖,不需要再定义版本号,玄机就在这里。
1):选择springboot的版本
关于springboot的版本号选择,参考下面网站:
https://mvnrepository.com/artifact/org.springframework.boot/spring-boot
Maven Repository: org.springframework.boot » spring-boot (mvnrepository.com)https://mvnrepository.com/artifact/org.springframework.boot/spring-boot
2):maven仓库相关仓库服务 (aliyun.com)https://developer.aliyun.com/mvn/view
此时再看项目,2.5.5版本已经引入:
。
顺便贴一下我的maven中配置的镜像地址:
接下来开始在根pom文件,引入其他的依赖:
第四步:
在studentmanage-web目录中添加springboot的web依赖,添加主启动类,添加配置文件
可以看到已经启动成功了。



