构建Spring Boot项目

前段时间写了SSM框架的整合,这一篇再写一下构建SpringBoot项目

先来看看Spring Boot的官方定义

Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".

We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need minimal Spring configuration.

Spring虽然同一管理了类,并利用IOC,AOP等特性给我们带来了许多便利。但随着功能的扩展,配置越来越多,被称为配置地狱,有点背离了当时简化开发的初衷。于是Spring Boot应运而生,简化配置,让我们甚至可以“just run”。

当时那篇整合SSM真的尽是在贴配置文件【捂脸】

接下来是正文

一、官网快速构建

打开Spring官网找到Spring Boot  

传送门https://spring.io/projects/spring-boot

 

 

 找到Quickstart Your Project

 

接下来选择工程类型,编程语言和一些项目的基本信息

 

最后点击GENERATE

构建完毕!

二、IDEA构建

IDEA专业版有Spring Boot

File->New->Project

 选择Spring Initializr,可以看到这里默认就是用官方提供的模板来创建的

 点击next

 

 

在这里选择你需要的依赖,就会导入相对应的启动器

创建完毕后直接运行xxxApplication类

这里可以看到内置的Tomcat已经运行起来了,在浏览器访问

 

出现这个页面 说明访问成功了

这是自带的Error页面

posted @ 2020-12-10 16:28  小白小承  阅读(98)  评论(0编辑  收藏  举报
分享到: