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

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>

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

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


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


是这个方法找不到,然后我就添加了如下配置:(最后解决问题)

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