mybatis generator 代码生成器maven配置


generatorConfig.properties --> resource文件夹下


# 数据库驱动jar 路径

drive.class.path=/Users/mac/.m2/repository/mysql/mysql-connector-java/5.1.30/mysql-connector-java-5.1.30.jar

# 数据库连接参数

jdbc.driver=com.mysql.jdbc.Driver

jdbc.url=jdbc:mysql://localhost:3306/test?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&connectionCollation=utf8mb4_bin&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&transformedBitIsBoolean=true

jdbc.username=root

jdbc.password=root

# 包路径配置

model.package=me.wanghui.comm.domain

dao.package=me.wanghui.service.mapper

xml.mapper.package=me.wanghui.service.mapper

target.project=src/test/java


generatorConfig.xml  --> resource文件夹下


PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"

"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">

password="${jdbc.password}">

-->

enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"

enableSelectByExample="false" selectByExampleQueryId="false">


pom.xml 文件生成器部分



1.3.2

${basedir}/src/main/resources/generatorConfig.xml

file:///${basedir}/src/main/resources/generatorConfig.properties

org.mybatis.generator

mybatis-generator-maven-plugin

${plugin.mybatis.generator}

${mybatis.generator.generatorConfig.xml}

true

true



配置完成后点击Intellij右侧边栏的 Maven Projects,选择pom文件所在的项目,选择Plugins,就能看到代码生成器了

你可能感兴趣的:(mybatis generator 代码生成器maven配置)