跳到主要内容
版本:2.0.7

覆盖 Spring Boot 依赖

Doubao 中英对照 Override Spring Boot Dependencies

在 Spring Boot 应用程序中使用 Spring for Apache Pulsar 时,Apache Pulsar 依赖版本由 Spring Boot 的依赖管理决定。如果你希望使用不同版本的 pulsar-client-all,则需要覆盖 Spring Boot 依赖管理所使用的版本;设置 pulsar.version 属性。

或者,要在受支持的 Spring Boot 版本下使用不同版本的 Spring for Apache Pulsar,设置 spring-pulsar.version 属性。

在以下示例中,使用的是 Pulsar 客户端和 Spring for Apache Pulsar 的 snapshot 版本。

ext['pulsar.version'] = '4.4.2-SNAPSHOT'
ext['spring-pulsar.version'] = '2.0.1-SNAPSHOT'

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-pulsar'
}
<properties>
<pulsar.version>4.4.2-SNAPSHOT</pulsar.version>
<spring-pulsar.version>2.0.1-SNAPSHOT</spring-pulsar.version>
</properties>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-pulsar</artifactId>
</dependency>