gpt4 book ai didi

java - Maven 依赖项问题 : UnsolvableVersionConflictException

转载 作者:行者123 更新时间:2023-12-01 17:59:24 32 4
gpt4 key购买 nike

我是 grpc 和 java 新手。

我的依赖项有一个大问题:

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文件中的实际依赖项:

<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.1io.grpc:grpc-services:jar:1.27.1 的依赖项。这些 Artifact 目前不包含在 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 引入的依赖项远远超出了许多用户的需要。

关于java - Maven 依赖项问题 : UnsolvableVersionConflictException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60662804/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com