【JAVA_springboot包冲突的问题】

spring boot常见的问题


最近在做spring boot项目的时候出现了一个很难弄的问题,找了老半天也没有个详细的解决的方法,后来才发现是包的冲突问题,特此记录,帮助和我遇到相同的问题的人。

出现的问题

Description:

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

    com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor.<clinit>(PaginationInnerInterceptor.java:70)

The following method did not exist:

    net.sf.jsqlparser.schema.Column.withColumnName(Ljava/lang/String;)Lnet/sf/jsqlparser/schema/Column;

The method's class, net.sf.jsqlparser.schema.Column, is available from the following locations:

    jar:file:/E:/apache-maven-3.8.1-bin/localMaven3.8.1/com/github/jsqlparser/jsqlparser/3.2/jsqlparser-3.2.jar!/net/sf/jsqlparser/schema/Column.class

The class hierarchy was loaded from the following locations:

    net.sf.jsqlparser.schema.Column: file:/E:/apache-maven-3.8.1-bin/localMaven3.8.1/com/github/jsqlparser/jsqlparser/3.2/jsqlparser-3.2.jar
    net.sf.jsqlparser.parser.ASTNodeAccessImpl: file:/E:/apache-maven-3.8.1-bin/localMaven3.8.1/com/github/jsqlparser/jsqlparser/3.2/jsqlparser-3.2.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of net.sf.jsqlparser.schema.Column


Process finished with exit code 1

运行项目出现这个报错;

解决方法

针对此包冲突的问题,我们需要借助mavenhelper 插件

下载插件:

在这里插入图片描述
安装上插件后点击pom.xml
在这里插入图片描述
之后点击左下角的Dependency Analyzer
在这里插入图片描述选中 Conflicts==> 选中需要解决的冲突 ==》 鼠标右键,exclude; 如果不是根的话就,Jump left Tree 之后再 exclude。
操作完毕后记得进行Reimport,

  • 7
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值