1.新建Maven工程
2.导包
打开Maven Repository: mysql (mvnrepository.com)(所有jar包定位库),寻找所需jar包定位
2.1选择mysql-connector 5.1.38
#mysql-connector jar包
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version>
</dependency>
2.2选择lombok 1.18.22
#lombok 1.18.22 jar包
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
</dependency>
2.3将代码段复制到pom.xml中 <dependencies></dependencies>位置