都2020年了,你还在手动创建SpringBoot项目吗?今天教你在线快速创建一个SpringBoot项目,瞬间高大上有木有!
进入正题,首先打开创建SpringBoot的官网:https://start.spring.io/
①选择Project构建工具 -> Maven Project
②选择Language -> Java
③选择SpringBoot版本 -> 2.3.2当前稳定版本
④填入Project Metadata
Group:一般是倒域名【org.louis】
Artifact:项目名【blog】
Name:项目名【blog】
Description:描述【A popular online mall.】
Packaging:打包类型【Jar】,SpringBoot运行时的打包项目,一般SpringBoot都是打为Jar包,如果使用Tomcat容器的话就选择War包
Java:Java版本,主流项目选Java8,个人项目可以选择Java11进行测试
接下来是重点:引入依赖【Dependencies】
这里推荐一些经常使用的依赖:
①Spring Web:Build web, including RESTful, applications using Spring MVC. Uses Apache Tomcat as the default embedded container.
②Spring Data JPA:Persist data in SQL stores with Java Persistence API using Spring Data and Hibernate.
③Spring Data Redis:Advanced and thread-safe Java Redis client for synchronous, asynchronous, and reactive usage. Supports Cluster, Sentinel, Pipelining, Auto-Reconnect, Codecs and much more.
④Spring Boot Actuator:Supports built in (or custom) endpoints that let you monitor and manage your application - such as application health, metrics, sessions, etc.
⑤MySQL Driver:MySQL JDBC and R2DBC driver.
⑥Java Mail Sender:Send email using Java Mail and Spring Framework's JavaMailSender.
⑦Thymeleaf:A modern server-side Java template engine for both web and standalone environments. Allows HTML to be correctly displayed in browsers and as static prototypes.
⑧Lombok:Java annotation library which helps to reduce boilerplate code.
再额外推荐一些常用的依赖:
org.springframework.boot spring-boot-starter-websocket org.springframework.boot spring-boot-starter-test test com.google.code.gson gson 2.8.2 net.sourceforge.nekohtml nekohtml 1.9.22 org.springframework.boot spring-boot-configuration-processor true io.jsonwebtoken jjwt 0.6.0 commons-fileupload commons-fileupload 1.3.1 commons-net commons-net 3.3 cn.hutool hutool-all 4.5.10 com.google.zxing core 3.1.0 io.springfox springfox-swagger2 2.9.2 io.springfox springfox-swagger-ui 2.9.2 com.alibaba fastjson 1.2.58 com.jcraft jsch 0.1.49 com.vdurmont emoji-java 4.0.0 org.java-websocket Java-WebSocket 1.3.5 org.apache.commons commons-compress 1.18 org.zeromq jeromq 0.3.1 javax.interceptor javax.interceptor-api 1.2
配置好之后,点击 EXPLORE 开始导出
在弹窗后点击 DOWNLOAD 开始下载
现在,一个完整的SpringBoot项目就创建好了!
解压出来用编辑器打开就可以开心的撸代码了!
推荐阅读:强烈推荐的 IntelliJ IDEA 插件,别说我没告诉你
喜欢的话记得推荐并收藏哦~~~