首先下载数据库连接驱动包mysql-connector-java-5.1.34.jar
我放在了本地文件夹E:\work\tools\mybatis下
创建generatorMaven.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">
<generatorConfiguration>
<!-- 数据库连接驱动包 -->
<classPathEntry location="E:\work\tools\mybatis\mysql-connector-java-5.1.34.jar" />
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<context id="DB2Tables" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressAllComments" value="true" />
</commentGenerator>
<!-- 数据库连接 -->
<jdbcConnection driverClass="com.m