mybatis-enhance-actable引入后,Mapper对象注入失败,找不到OrderBy这个类

在项目中引入mybatis-plus-boot-starter3.5.2和mybatis-enhance-actable1.5.0.RELEASE时,由于后者包含的mybatis-plus-annotation版本较低(3.4),覆盖了前者的依赖,导致mapper对象创建失败。解决方法是排除mybatis-enhance-actable中的mybatis-plus-annotation依赖,避免版本冲突。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

错误:ClassNotFound:ncom/baomidou/mybatisplus/annotation/OrderBy

        <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-boot-starter</artifactId>
             <version>3.5.2</version>
        </dependency>

<!--  自动更新数据库表结构      -->
        <dependency>
            <groupId>com.gitee.sunchenbin.mybatis.actable</groupId>
            <artifactId>mybatis-enhance-actable</artifactId>
            <version>1.5.0.RELEASE</version>
            <!--这里必须拒绝加载自己的,不然与MybatisPlus的冲突-->
            <exclusions>
                <exclusion>
                    <groupId>com.baomidou</groupId>
                    <artifactId>mybatis-plus-annotation</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

开始的时候mybatis-plus-boot-starter引入的jar包是3.5.2--其对应加入的mybatis-plus-annotation依赖是3.5.2,但是加入mybatis-enhance-actable最新版本1.5.0.RELEASE,其对应加入的mybatis-plus-annotation依赖是3.4版本的,覆盖了我的mybatis-plus-boot-starter所需的依赖,所以导致mapper对象创建的时候失败,这时就需要将mybatis-enhance-actable加入的mybatis-plus-annotation剔除掉。避免冲突覆盖mybatis-plus-boot-starter所需版本依赖。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值