这里写自定义目录标题
一 为什么要使用Maven
jar包很难找全,jar包的版本可能不修改项目需求,百度的会有问题,不能使用,使用Maven可以自动下载jar包,实际的框架内部存在错综复杂的依赖关系
1 依赖管理 帮助管jar包
随着SpringBoot等框架的高集成的框架引入,一个项目往往需要上百个jar包
而如果用Maven来管理,只需要依据功能,配置个位数依赖
<!-- Nacos 服务注册发现启动器 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- web启动器依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- 视图模板技术 thymeleaf -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
2 构建管理 脱离IDE进行运行
2.1 传统方式,就是打包成war包,然后放在tomacat上运行
修改这个tomcat为本地的tomcat版本
点击add
添加成功后运行