Spring Boot是由Pivotal团队提供的全新框架,设计目的是用来简化新Spring应用的初始搭建以及开发过程。它主要推崇的是'消灭配置’,实现零配置。html
那么,如何快速新建一个一个springboot项目脚手架呢?目前,市面主流的两种方式:一种主要利用 Spring 官方提供的在线项目脚手架来搭建 SpringBoot 的项目;另外一种使用开发工具IDE(好比,IntelliJ IDEA)集成的插件快速建立。java
# 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>
打开地址: https://start.spring.io/mysql
根据须要选择:web
* 选择你的项目是 maven 仍是 grade
* 开发语言有:Java、Kotlin、Groovy
* 选择 Spring Boot 的版本
* 填写 maven 的 Group 、Artifactspring
你能够在这里输入关键字,如:mysql、mybatis、cache、web等。点击 Switch to the full version,往下翻你会发现页面展开了好多选择项以供选择(此步能够忽略,不作选择)。sql
# Spring 把依赖项分了一些组,以便于查找,如: # 核心依赖(Core) # Web项目经常使用依赖(Web) # 模板引擎(Template Engines) # 数据库(SQL) # 非关系数据库(NoSQL) # 云(Cloud xxx)
当你把依赖项都选择完毕后,点击那个绿色的大按钮(Generate Project)就会下载一个项目依赖配置好的项目了(点击生成的zip文件下载解压,而后maven 引入就好)。数据库
<?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>
----------------------------------------------------apache
本文为博主原创文章,转载请注明出处!tomcat
----------------------------------------------------springboot