项目git地址:https://github.com/ricky739996585/BaseSpringBoot.git
1.用idea 创建一个springboot项目(如果用eclipse开发,下载spring-tools-suite来创建springboot项目):
这里不详细介绍如何创建了,有一个关键需要注意的是:
2.在原本的pom.xml中加入以下以来:
<!-- springboot热部署依赖 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> </dependency> <!-- mysql依赖 --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <!-- 高性能JDBC连接池组件 ,性能比常用的 c3p0、tomcat、bone、vibur 这些要高很多 --> <dependency> <groupId>com.zaxxer</groupId> <artifactId>HikariCP</artifactId> <!-- 版本号可以不用指定,Spring Boot会选用合适的版本 --> </dependency> <!-- mybatis --> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId