好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

MyEclipse2018中安装Mybatis generator插件的实现步骤

前言

在使用maven配置mybatis generator插件时报以下错误,generator插件一直无法使用,查询资料说和eclipse版本有关系。

the pom for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available

无奈之下选择安装eclipse的插件。

安装步骤(基于myeclipse2018)

点击help-->install from catalog...

在搜索框输入mybatis generator出现点击install-->finish.如下图所示

安装完成后在项目中右击新建mybatis generator configuration file.如下图所示

点击next 选择文件生成的路径以及文件名,如下图所示

点击finfish。具体配置可参考以下配置进行修改

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

<?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>

 

  <context id= "context1" >

   <!-- 数据库链接url,用户名、密码 -->

   <jdbcconnection connectionurl= "jdbc:mysql://localhost:3306/miaosha?characterencoding=utf8" driverclass= "com.mysql.jdbc.driver" password= "jma3" userid= "root" />

   <!-- 生成model模型,对应的包 -->

   <javamodelgenerator targetpackage= "com.jian.miaosha.dataobject" targetproject= "miaosha/src/main/java" />

   <!-- 对应的xml mapper文件 -->

   <sqlmapgenerator targetpackage= "mapping" targetproject= "miaosha/src/main/resources" />

   <!-- 对应的dao接口 -->

   <javaclientgenerator targetpackage= "com.jian.miaosha.dao" targetproject= "miaosha/src/main/java" type= "xmlmapper" />

  

   <!-- 要生成的表 -->

   <table schema= "" tablename= "customer_password" >

  

   </table>

   <table schema= "" tablename= "customer" >

  

   </table>

  </context></generatorconfiguration>

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

原文链接:https://segmentfault测试数据/a/1190000018145466

查看更多关于MyEclipse2018中安装Mybatis generator插件的实现步骤的详细内容...

  阅读:9次