1、新建maven项目,新建文件夹和配置文件如下
2、配置文件代码
generator.properties
driver=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=UTC
username=root
password=root
#entity 包名和 java目录
modelPackage=com.genox.model
modelProject=src/main/java
#sqlmap包名 和resources目录
sqlPackage=com.genox.mapper
sqlProject=src/main/java
#mapper包名和 java目录
mapperPackage=com.genox.dao
mapperProject=src/main/java
generatorConfig.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd&#