maven的jar包冲突问题解决方案

报错信息:

An attempt was made to call the method com.google.common.collect.FluentIterable.append(Ljava/lang/Iterable;)Lcom/google/common/collect/FluentIterable; but it does not exist. Its class, com.google.common.collect.FluentIterable, is available from the following locations:
    jar:file:/C:/Users/XXX/.m2/repository/com/google/guava/guava/16.0.1/guava-16.0.1.jar!/com/google/common/collect/FluentIterable.class
It was loaded from the following location:
    file:/C:/Users/XXX/.m2/repository/com/google/guava/guava/16.0.1/guava-16.0.1.jar

这个原因是导入jar包的时候,jar包兼容性问题

解决方案:

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.google.guavagroupId>
                <artifactId>guavaartifactId>
                <version>20.0version>
            dependency>
        dependencies>
    dependencyManagement>

你可能感兴趣的:(日常错误处理)