方案一:排除冲突依赖 修改pom.xml: 在MyBatis Plus和PageHelper的依赖中添加<exclusions>标签,排除jsqlparser依赖。 xml <!-- MyBatis-Plus依赖 --> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> &...
因此,当PageHelper和MyBatis-Plus同时存在于一个项目中时,Maven等构建工具会根据其自身的解析规则选择一个版本进行加载,但这可能导致某些功能无法正常工作,甚至引发编译错误。 为了确保项目的顺利运行,开发者需要仔细评估PageHelper和MyBatis-Plus之间的版本差异,并采取适当的措施来解决这一问题。一种常见的解决方案是升级P...
在实际开发中,MyBatis-Plus和PageHelper的共存问题主要源于它们对jsqlparser库的不同依赖版本。MyBatis-Plus和PageHelper都依赖于jsqlparser来解析和处理SQL语句,但它们所使用的版本并不一致。这种版本差异导致了以下几种常见的冲突现象: 类加载冲突:当两个框架同时引入不同版本的jsqlparser库时,类加载器可能会加载错误...
因为pagehelper-spring-boot-starter所依赖的mybatis-spring,mybatis与 mybatis-plus-boot-starter所依赖的mybatis-spring,mybatis发生冲突只要排除掉就可以了。 解决: 在pom文件中排除一下 <!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper --><dependency><groupId>com.github.pagehelper<...
从而产生了冲突,pagehelper是包含了Mybatis以及Mybatis-Spring,而MyBatis-Spring依赖冲突,系统自动用了MyBatis=plus的MyBatis-spring。 解决方法: 如果不需要用到pagehelper-spring-boot-starter相关,可以注释掉pagehelper-spring-boot-starter依赖。 或者可以把pagehelper中的mybatis依赖删除即可。
先说一下问题出现的原因:Mybatis和Mybatis-plus存在冲突,Pagehelper依赖于Mybatis,所以冲突了!! 解决方案:删Pagehelper和Mybatis的依赖,然后一点点的改若依一些基本配置的分页就好,最后在加上Mybatis-plus的分页插件配置!最最重要的是要扫描到写的分页插件,不然不生效! ...
检查配置都没有问题,百度得知是mybatis-plus和pagehelper依赖冲突导致,pom文件中导入同时导入了这两个依赖 <dependency><groupId>com.github.pagehelper</groupId><artifactId>pagehelper-spring-boot-starter</artifactId><version>1.2.10</version></dependency><dependency><groupId>com.baomidou</groupId><artifactId...
2. 配置 mybatisplus package com.whu.config; import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer; import com.baomidou.mybatisplus.core.MybatisConfiguration; import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
pagehelper依赖包中由上图得知,也是包含了MyBatis以及 MyBatis-Spring,而MyBatis-Spring依赖冲突,系统自动用了Mybatis-plus中的MyBatis-Spring,所以我们只需要把pagehelper中的mybatis依赖删除即可,具体操作如下 在version 下面添加 exclusions依赖(排除) <!-- pagehelper--><dependency><groupId>com.github.pagehelper<...