一.pom文件,加入如下代码
org.springframework.boot
spring-boot-maven-plugin
org.mybatis.generator
mybatis-generator-maven-plugin
1.3.2
${basedir}/src/main/resources/mybatis_generate.xml
true
true
mysql
mysql-connector-java
5.1.28
runtime
二.resources文件夹下创建mybatis_generate.xml文件
/p>
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/test?serverTimezone=CTT"
userId="root" password="root" />
targetPackage="com.rainbow.test.model"
targetProject="src/main/java">
targetProject="src/main/resources">
targetPackage="com.rainbow.test.mapper"
targetProject="src/main/java" type="XMLMAPPER">
三.运行maven插件命令:mybatis-generator:generate
成功...