Maven依赖冲突

An attempt was made to call a method that does not exist

依赖冲突完整报错如下

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

它可以帮助我们更好的管理Maven的依赖
这里我们需要借助一个插件——MavenHelper
Maven依赖冲突_第1张图片

下载好插件后,随便打开一个pom.xml文件,点击红框内
Maven依赖冲突_第2张图片

可进入下面的页面
Maven依赖冲突_第3张图片

点击对应的依赖,可以查看具体的冲突
Maven依赖冲突_第4张图片

也可以根据具体的冲突查看到底是哪一块pom出了问题
右击可选择查看模式
Maven依赖冲突_第5张图片

  • Jump to Left Tree
    • 以树形查看依赖

Maven依赖冲突_第6张图片

  • Jump to Source
    • 在pom.xml 文件中查看依赖
    • 直接跳转到对应的依赖处

Maven依赖冲突_第7张图片

  • Exclude
    • 将该依赖排除
    • 这是比较常用的,点击之后,pom中会自动生成排除的代码

Maven依赖冲突_第8张图片

最后再去页面中刷新一下UI以及重新导入,就可以看到冲突消失了
Maven依赖冲突_第9张图片

冲突消失后,上面会出现No conflicts的字样
Maven依赖冲突_第10张图片

你可能感兴趣的:(环境配置,日常项目坑,maven,java)