在线官网Spring Initializr 或 IntelliJ IDEA 快速搭建springboot项目
Spring Boot是由Pivotal团队提供的全新框架,设计目的是用来简化新Spring应用的初始搭建以及开发过程。它主要推崇的是'消灭配置’,实现零配置。
那么,如何快速新建一个一个springboot项目脚手架呢?目前,市面主流的两种方式:一种主要利用 Spring 官方提供的在线项目脚手架来搭建 SpringBoot 的项目;另一种使用开发工具IDE(比如,IntelliJ IDEA)集成的插件快速创建。
一、Spring 官方提供的在线项目脚手架来搭建
1.1 知识储备
# Group 、Package Name中填总包名的前缀,如com.bingbinlee
# Artifact 中填项目名
# 要选择的依赖
Core下的Cache
Web下的Web
Template Engines下的Thymeleaf
SQL下的MySQL(如果要mybatis的话也把这个勾上)
# 如果要支持jsp的话就在pom.xml加上jasper的jar <!--添加对jsp的支持-->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<!--此处的<scope></scope>一定不要加上作用于为provided,可以为compile或缺省-->
</dependency>
1.2 第一步:选择版本和类型
打开地址: https://start.spring.io/

根据需要选择:
* 选择你的项目是 maven 还是 grade
* 开发语言有:Java、Kotlin、Groovy
* 选择 Spring Boot 的版本
* 填写 maven 的 Group 、Artifact
1.3 第二步:添加依赖

你可以在这里输入关键字,如:mysql、mybatis、cache、web等。点击 Switch to the full version,往下翻你会发现页面展开了好多选择项以供选择(此步可以忽略,不做选择)。
# Spring 把依赖项分了一些组,以便于查找,如: # 核心依赖(Core) # Web项目常用依赖(Web) # 模板引擎(Template Engines) # 数据库(SQL) # 非关系数据库(NoSQL) # 云(Cloud xxx)
1.4 第三步:下载项目
当你把依赖项都选择完毕后,点击那个绿色的大按钮(Generate Project)就会下载一个项目依赖配置好的项目了(点击生成的zip文件下载解压,然后maven 引入就好)。
二、IntelliJ IDEA 快速搭建springboot项目
2.1 首先我们IDEA软件,点击"Create New Project"

2.2 在你建立的工程下创建 Module 选择Spring initializr创建

2.3 然后 Group 这些可以自己命名,也可以用系统的,记得 Type 选择 Maven Project ,写好之后点击 "Next"

2.4 选中 左边 "Web" ,然后选中右边复选框 web,这个窗口的勾选,主要是为了IDEA自动创建这些依赖,可以根据自己习惯进行勾选

2.5 最后一步,核对新建项目信息无误,点击 ”Finish“ 即可

2.6 建立好的项目结构

2.7 pom.xml 可以根据后续项目实际需求添加修改
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.bingbinlee</groupId>
<artifactId>crontab</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>crontab</name>
<description>crontab</description> <properties>
<java.version>1.8</java.version>
</properties> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies> <build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build> </project>
----------------------------------------------------------------------------
本文为博主原创文章,转载请注明出处!
-----------------------------------------------------------------------------
在线官网Spring Initializr 或 IntelliJ IDEA 快速搭建springboot项目的更多相关文章
- Spring系列之——使用模板快速搭建springboot项目
1 在官网https://start.spring.io/生成spring boot的模板 2 IDEA导入模板,设置如下勾选项,其他选项卡为默认值 3 idea呈现 4 新增controller类 ...
- Spring Boot 学习(一) 快速搭建SpringBoot 项目
快速搭建一个 Spring Boot 项目 部分参考于<深入实践Spring Boot>.<Spring实战 第四版>与程序猿DD的有关博客. 参考(嘟嘟独立博客):http: ...
- 基于 intellij IDEA 快速搭建Spring Boot项目
在<一步步搭建 Spring Boot maven 框架的工程>一文中,已经介绍了如何使用Eclipse快速搭建Spring Boot项目.由于最近将开发工具由Eclipse ...
- idea:spring initializr无web勾选,maven方式搭建springboot项目。jdk7创建springboot项目的版本不兼容问题。
一.idea 使用spring initializr不选择web搭建springboot项目 1.file => new => project 2.直接next到finish结束. 3.完 ...
- Spring Boot入门-快速搭建web项目
Spring Boot 概述: Spring Boot makes it easy to create stand-alone, production-grade Spring based Appli ...
- 看了 Spring 官网脚手架真香,也撸一个 SpringBoot DDD 微服务的脚手架!
作者:小傅哥 博客:https://bugstack.cn 沉淀.分享.成长,让自己和他人都能有所收获! 一.前言 为什么我们要去造轮子? 造轮子的核心目的,是为了解决通用共性问题的凝练和复用. 虽然 ...
- IntelliJ IDEA 快速搭建 Spring MVC环境
IntelliJ在业界被公认为最好的java开发工具之一,尤其在智能代码助手.代码自动提示.重构.J2EE支持.Ant.JUnit.CVS整合.代码审查. 创新的GUI设计等方面的功能可以说是超常的. ...
- 在线快速创建SpringBoot项目
都2020年了,你还在手动创建SpringBoot项目吗?今天教你在线快速创建一个SpringBoot项目,瞬间高大上有木有! 进入正题,首先打开创建SpringBoot的官网:https://sta ...
- IntelliJ IDEA 2017 创建SpringBoot项目, 及.jar没有主清单属性解决办法
1. 创建项目: File >> New >> Spring Initializr 选好 SDK, 及 依赖包(比如 Web >> Web ) . 需要使用 ...
随机推荐
- 《The One!团队》第一次作业:团队亮相
项目 内容 作业所属课程 http://www.cnblogs.com/nwnu-daizh/ 作业要求 https://www.cnblogs.com/nwnu-daizh/p/10687492.h ...
- Access computer files on iPad without using iTunes.
going to my CSDN blog ---> https://blog.csdn.net/qq_37746801/article/details/89708103
- SpringBoot集成WebSocket【基于纯H5】进行点对点[一对一]和广播[一对多]实时推送
代码全部复制,仅供自己学习用 1.环境搭建 因为在上一篇基于STOMP协议实现的WebSocket里已经有大概介绍过Web的基本情况了,所以在这篇就不多说了,我们直接进入正题吧,在SpringBoot ...
- Linux 开机、重启和用户登录注销、用户管理、用户组
l 关机&重启命令 基本介绍: shutdown –h now 立该进行关机 shudown -h 1 "hello, 1 分钟后会关机了" shutdown –r n ...
- thymeleaf常用语法
常用标签语法:①th:text<span th:text="${name}">1</span>注释:如果${name}有值则将替换掉1的值,若无则为1 ②t ...
- GridView控件详解
一.介绍 GridView控件一表格形式显示数据源中的数据.提供对列进行排序.分页以及编辑.删除单个记录的功能. 二.绑定数据源 第一种使用DataSourceID属性.可以直接把GridView控件 ...
- 资料整理:基于node push server实现push notification
chat example based on ionic/ socket.io/ redis https://github.com/jbavari/ionic-socket.io-redis-chat ...
- 初学spring-boot
部分转载自:http://blog.java1234.com 一.简介 Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程.该框架 ...
- 用jQuery来绑定事件的3种方法和区别
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- CVE-2017-6920 Drupal远程代码执行漏洞学习
1.背景介绍: CVE-2017-6920是Drupal Core的YAML解析器处理不当所导致的一个远程代码执行漏洞,影响8.x的Drupal Core. Drupal介绍:Drupal 是一个由 ...