springboot相关笔记
1.配置环境
1.springboot 下载jdk1.8,以及配置国内镜像,使用alibaba的maven导入进去。
2.配置pom文件。参考代码
注意jdk1.8对应的spring-boot-starter-parent的版本应该是2.x.x.这里引入了mybatis-plus依赖
<?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 https://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.7.8</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo8</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo8</name>
<description>demo8</description>
<properties>
<java.version>8</java.version>
<!-- 数据库驱动 -->
<mysql-connector.version>8.0.26</mysql-connector.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>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.22</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>