Mybatis-plus与Mybatis依赖冲突问题解决(An attempt was made to call a method that does not exist.)

今天碰见一个版本冲突问题具体冲突如下:

An attempt was made to call a method that does not exist.
 The attempt was made from the following location:

 com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder.getLanguageDriver
 (MybatisMapperAnnotationBuilder.java:369)

The following method did not exist:

com.baomidou.mybatisplus.core.MybatisConfiguration.getLanguageDriver
(Ljava/lang/Class;)Lorg/apache/ibatis/scripting/LanguageDriver;

The method's class, com.baomidou.mybatisplus.core.MybatisConfiguration,
 is available from the following locations:

当时的spirngboot版本和mybatis版本如下:(这是修改以后又重新指定了一下mybatis的版本指定为最新版本的了。)

	<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.7.RELEASE</version>
        <relativePath/>
    </parent>
    <!--定义版本-->
    <properties>
      <mybatis.plus.starter.version>3.1.1</mybatis.plus.starter.version>
    </properties>
            <!--解决myabatis版本冲突问题-->
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-boot-starter</artifactId>
                <version>${mybatis.plus.starter.version}</version>
            </dependency>

出现问题得图片,有个位置点进去

在这里插入图片描述
在这里插入图片描述
是这个方法找不到,然后我就添加了如下配置:(最后解决问题)

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.7.RELEASE</version>
        <relativePath/>
    </parent>

    <!--定义版本-->
    <properties>
      <mybatis.plus.starter.version>3.1.1</mybatis.plus.starter.version>
    </properties>

 
            <!--解决myabatis版本冲突问题-->
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-boot-starter</artifactId>
                <version>${mybatis.plus.starter.version}</version>
                <exclusions>
                    <exclusion>
                        <artifactId>mybatis</artifactId>
                        <groupId>org.mybatis</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.mybatis</groupId>
                <artifactId>mybatis</artifactId>
                <version>3.5.6</version>
            </dependency>

参考地址:https://blog.csdn.net/Octopus21/article/details/114879758

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值