jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/51zxw?characterEncoding=utf-8
jdbc.username=root
jdbc.password=123456
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<!--引入外部的数据配置属性信息-->
<properties resource="db.properties"/>
<context id="Mysql" targetRuntime="MyBatis3Simple" defaultModelType="flat">
<property name="beginningDelimiter" value="`"/>
<property name="endingDelimiter" value="`"/>
<plugin type="tk.mybatis.mapper.generator.MapperPlugin">
<property name="mappers" value="tk.mybatis.mapper.common.Mapper"/>
<property name="caseSensitive" value="true"/>
</plugin>
<jdbcConnection driverClass="${jdbc.driver}"
connectionURL="${jdbc.url}"
userId="${jdbc.username}"
password="${jdbc.password}">
</jdbcConnection>
<!--实体类位置-->
<javaModelGenerator targetPackage="com.wyzxw.entity"
targetProject="src/main/java"/>
<!--XXXMapper.xml-->
<sqlMapGenerator targetPackage="mapper"
targetProject="src/main/resources"/>
<!--XXXMapper接口-->
<javaClientGenerator targetPackage="com.wyzxw.mapper"
targetProject="src/main/java"
type="XMLMAPPER"/>
<table tableName="Employee" domainObjectName="Employee">
<!--column是指定表中主键的名字,所以在建表时要有主键-->
<generatedKey column="empid" sqlStatement="JDBC"/>
</table>
<table tableName="Depart" domainObjectName="Depart">
<generatedKey column="depid" sqlStatement="JDBC"/>
</table>
</context>
</generatorConfiguration>
Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.6:generate (default-cli) on project Mybatis: Could not create connection to database server.