mybatis自动生成器使用时的配置报错解决:Failure to find org.eclipse.m2e:lifecycle-mapping:pom:1.0.0

配置
在这里插入图片描述
mybatis-generator.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>
    <!-- 一个数据库一个context -->
    <context id="DB2Tables" targetRuntime="Mybatis3">
        <!-- jdbc连接 -->
        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                        connectionURL="jdbc:mysql://127.0.0.1:3306/miaosha" userId="root"
                        password="123456" />
        <!-- 生成DataObject类地址 -->
        <javaModelGenerator targetPackage="com.NEU.dataobject"
                            targetProject="src/main/java" >
            <!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
            <property name="enableSubPackages" value="true"/>
            <!-- 是否针对string类型的字段在set的时候进行trim调用 -->
            <property name="trimStrings" value="true"/>
        </javaModelGenerator>
        <!-- 生成mapxml文件 -->
        <sqlMapGenerator targetPackage="mapping"
                         targetProject="src/main/resources" >
            <!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
            <property name="enableSubPackages" value="true" />
        </sqlMapGenerator>

        <!-- 生成mapxml对应client,也就是接口dao -->
        <javaClientGenerator targetPackage="com.NEU.dao"
                             targetProject="src/main/java" type="XMLMAPPER" >
            <!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
            <property name="enableSubPackages" value="true" />
        </javaClientGenerator>
        <!-- 配置表信息 -->
        <!--<table tableName="user_info" domainObjectName="UserDO"-->
        <!--enableCountByExample="false"-->
        <!--enableUpdateByExample="false"-->
        <!--enableDeleteByExample="false"-->
        <!--enableSelectByExample="false"-->
        <!--selectByExampleQueryId="false"></table>-->
        <!--<table tableName="user_password" domainObjectName="UserPasswordDO"-->
        <!--enableCountByExample="false"-->
        <!--enableUpdateByExample="false"-->
        <!--enableDeleteByExample="false"-->
        <!--enableSelectByExample="false"-->
        <!--selectByExampleQueryId="false"></table>-->
        <!--<table tableName="item" domainObjectName="ItemDO"-->
        <!--enableCountByExample="false"-->
        <!--enableUpdateByExample="false"-->
        <!--enableDeleteByExample="false"-->
        <!--enableSelectByExample="false"-->
        <!--selectByExampleQueryId="false"></table>-->
        <!--<table tableName="item_stock" domainObjectName="ItemStockDO"-->
        <!--enableCountByExample="false"-->
        <!--enableUpdateByExample="false"-->
        <!--enableDeleteByExample="false"-->
        <!--enableSelectByExample="false"-->
        <!--selectByExampleQueryId="false"></table>-->
        <!--<table tableName="order_info" domainObjectName="OrderDO"-->
        <!--enableCountByExample="false"-->
        <!--enableUpdateByExample="false"-->
        <!--enableDeleteByExample="false"-->
        <!--enableSelectByExample="false"-->
        <!--selectByExampleQueryId="false"></table>-->
        <!--<table tableName="sequence_info" domainObjectName="SequenceDO"-->
        <!--enableCountByExample="false"-->
        <!--enableUpdateByExample="false"-->
        <!--enableDeleteByExample="false"-->
        <!--enableSelectByExample="false"-->
        <!--selectByExampleQueryId="false"></table>-->
        <table tableName="user_info" domainObjectName="UserDO"></table>
        <table tableName="user_password" domainObjectName="UserPasswordDO"></table>

    </context>
</generatorConfiguration>

解决思路:
参考:https://blog.csdn.net/weixin_46544994/article/details/106940070
下载 https://github.com/mfriedenhagen/dummy-lifecycle-mapping-plugin

2、解压dummy-lifecycle-mapping-plugin.zip文件,在IDEA中点击File>>OPENT 打开这个目录下pom文件,选择一文件的方式打开,

在打开的pom文件右键open in terminal 在命令窗口执行执行mvn clean install 回车执行即可。

但是build遇到了问题,就是Error:java: 不再支持源选项 5。请使用 7或更高版本。
pom文件中添加:

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<java.version>11</java.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>

解决

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值