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="/Users/lyv/.m2/repository/mysql/mysql-connector-java/5.1.44/mysql-connector-java-5.1.44.jar" />
<context id="context" targetRuntime="MyBatis3">
<property name="javaFileEncoding" value="UTF-8" />
<!--注释-->
<!--<commentGenerator type="cn.kelaile.bigdata.common.mybatis.MyCommentGenerator">-->
<!--<!– <property name="suppressAllComments" value="true"/> –>-->
<!--<!– <property name="suppressDate" value="true"/> –>-->
<!--</commentGenerator>-->
<!-- 配置路径 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/lv?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true"
userId="root" password="123458" />
<javaModelGenerator targetPackage="com.lyv.springboot.domain"
targetProject="/Users/lyv/Documents/ideawork/src/main/java" />
<sqlMapGenerator targetPackage="com.lyv.springboot.mapper"
targetProject="/Users/lyv/Documents/ideawork/src/main/java" />
<javaClientGenerator targetPackage="com.lyv.springboot.dao"
targetProject="/Users/lyv/Documents/ideawork/src/main/java"
type="XMLMAPPER" />
<table tableName="customer" mapperName="CustomerDao" domainObjectName="Customer"
enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
</table>
</context>
</generatorConfiguration>
运行后报错
[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project springboot-test1: XML Parser Error on line 33: 必须为元素类型 "table" 声明属性 "mapperName"。 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Disconnected from the target VM, address: '127.0.0.1:52591', transport: 'socket'
Process finished with exit code 1
Mapper.xml bean 和数据库字段写错