与Maven依赖项有关的问题:UnsolvableVersionConflictException [英] Issues with maven dependencies: UnsolvableVersionConflictException

查看:95
本文介绍了与Maven依赖项有关的问题:UnsolvableVersionConflictException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是grpc和java的新手.

Im new in grpc and java.

我的依赖项有很大的问题:

I have a big problem with my dependencies:

由以下原因引起:org.eclipse.aether.collection.UnsolvableVersionConflictException:无法解决[io.grpc:grpc-all:jar:1.27.1-> io.grpc:grpc-core:jar:[1.27]之间的版本冲突.1,1.27.1],io.grpc:grpc-all:jar:1.27.1-> io.grpc:grpc-netty:jar:1.27.1-> io.grpc:grpc-core:jar:[1.27.1,1.27.1],io.grpc:grpc-all:jar:1.27.1-> io.grpc:grpc-okhttp:jar:1.27.1-> io.grpc:grpc-core:jar:[1.27.1,1.27.1],io.grpc:grpc-all:jar:1.27.1-> io.grpc:grpc-testing:jar:1.27.1-> io.grpc:grpc-core:jar:[1.27.1,1.27.1],net.devh:grpc-spring-boot-starter:jar:2.6.2.RELEASE-> net.devh:grpc-server-spring-boot-starter:jar:2.6.2.RELEASE-> net.devh:grpc-server-spring-boot-autoconfigure:jar:2.6.2.RELEASE-> net.devh:grpc-common-spring-boot:jar:2.6.2.RELEASE-> io.grpc:grpc-core:jar:1.25.0,net.devh:grpc-spring-boot-starter:jar:2.6.2.RELEASE-> net.devh:grpc-server-spring-boot-starter:jar:2.6.2.RELEASE-> net.devh:grpc-server-spring-boot-autoconfigure:jar:2.6.2.RELEASE-> io.grpc:grpc-netty-shaded:jar:1.25.0-> io.grpc:grpc-core:jar:[1.25.0,1.25.0],net.devh:grpc-spring-boot-starter:jar:2.6.2.RELEASE-> net.devh:grpc-server-spring-boot-starter:jar:2.6.2.RELEASE-> net.devh:grpc-server-spring-boot-autoconfigure:jar:2.6.2.RELEASE-> io.grpc:grpc-services:jar:1.25.0-> io.grpc:grpc-core:jar:[1.25.0,1.25.0]]

Caused by: org.eclipse.aether.collection.UnsolvableVersionConflictException: Could not resolve version conflict among [io.grpc:grpc-all:jar:1.27.1 -> io.grpc:grpc-core:jar:[1.27.1,1.27.1], io.grpc:grpc-all:jar:1.27.1 -> io.grpc:grpc-netty:jar:1.27.1 -> io.grpc:grpc-core:jar:[1.27.1,1.27.1], io.grpc:grpc-all:jar:1.27.1 -> io.grpc:grpc-okhttp:jar:1.27.1 -> io.grpc:grpc-core:jar:[1.27.1,1.27.1], io.grpc:grpc-all:jar:1.27.1 -> io.grpc:grpc-testing:jar:1.27.1 -> io.grpc:grpc-core:jar:[1.27.1,1.27.1], net.devh:grpc-spring-boot-starter:jar:2.6.2.RELEASE -> net.devh:grpc-server-spring-boot-starter:jar:2.6.2.RELEASE -> net.devh:grpc-server-spring-boot-autoconfigure:jar:2.6.2.RELEASE -> net.devh:grpc-common-spring-boot:jar:2.6.2.RELEASE -> io.grpc:grpc-core:jar:1.25.0, net.devh:grpc-spring-boot-starter:jar:2.6.2.RELEASE -> net.devh:grpc-server-spring-boot-starter:jar:2.6.2.RELEASE -> net.devh:grpc-server-spring-boot-autoconfigure:jar:2.6.2.RELEASE -> io.grpc:grpc-netty-shaded:jar:1.25.0 -> io.grpc:grpc-core:jar:[1.25.0,1.25.0], net.devh:grpc-spring-boot-starter:jar:2.6.2.RELEASE -> net.devh:grpc-server-spring-boot-starter:jar:2.6.2.RELEASE -> net.devh:grpc-server-spring-boot-autoconfigure:jar:2.6.2.RELEASE -> io.grpc:grpc-services:jar:1.25.0 -> io.grpc:grpc-core:jar:[1.25.0,1.25.0]]

我在pom文件中的实际依赖项:

My actual dependencies in pom file:

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
        <version>2.2.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <version>2.2.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.session</groupId>
        <artifactId>spring-session-core</artifactId>
        <version>2.2.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
        <version>1.18.12</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-core</artifactId>
        <version>5.2.2.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-mongodb</artifactId>
        <version>2.2.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java-util</artifactId>
        <version>3.11.4</version>
    </dependency>
    <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>3.11.4</version>
    </dependency>
    <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-all</artifactId>
        <version>1.27.1</version>
    </dependency>
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>28.2-jre</version>
    </dependency>
    <dependency>
        <groupId>net.devh</groupId>
        <artifactId>grpc-spring-boot-starter</artifactId>
        <version>2.6.2.RELEASE</version>
    </dependency>
</dependencies>

感谢所有建议.

推荐答案

添加对 io.grpc:grpc-netty-shaded:jar:1.27.1 io.grpc的依赖:grpc-services:jar:1.27.1 .这些工件目前未包含在grpc-all中.

Add a dependency on io.grpc:grpc-netty-shaded:jar:1.27.1 and io.grpc:grpc-services:jar:1.27.1. These artifacts aren't presently included in grpc-all.

    <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-netty-shaded</artifactId>
        <version>1.27.1</version>
    </dependency>
    <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-services</artifactId>
        <version>1.27.1</version>
    </dependency>

请注意,gRPC团队希望您避免使用grpc-all,而是参考您需要的特定依赖项;grpc-all引入了比许多用户所需更多的依赖项.

As a note, gRPC team would prefer you to avoid grpc-all and instead reference the specific dependencies you need; grpc-all pulls in far more dependencies than many users need.

这篇关于与Maven依赖项有关的问题:UnsolvableVersionConflictException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆