解决Mybatis-plus和pagehelper依赖冲突
2019-10-14 本文已影响0人
T_wk
问题描述:
因项目需要,在springboot中需要引入mybatis-plus,在maven引入后,启动过程中报如下的错误:
![](https://img.haomeiwen.com/i19792779/5fcdc6f5f7a67f7b.png)
原因描述:
在项目中,事先已经引入了关于pagehelper相关的依赖:
![](https://img.haomeiwen.com/i19792779/42151477c53671a0.png)
现在引入了mybatis-plus依赖:
![](https://img.haomeiwen.com/i19792779/0ed1f873629ce03d.png)
从而产生了冲突,pagehelper是包含了Mybatis以及Mybatis-Spring,而MyBatis-Spring依赖冲突,系统自动用了MyBatis=plus的MyBatis-spring。
解决方法:
如果不需要用到pagehelper-spring-boot-starter相关,可以注释掉pagehelper-spring-boot-starter依赖。
或者可以把pagehelper中的mybatis依赖删除即可。
![](https://img.haomeiwen.com/i19792779/1409282ca50e8c81.png)