覆盖 Spring Boot 依赖项
当在 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 的快照版本。
Gradle
ext['pulsar.version'] = '4.4.2-SNAPSHOT'
ext['spring-pulsar.version'] = '2.0.1-SNAPSHOT'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-pulsar'
}
-
Maven
<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>