覆蓋 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>
© . This site is unofficial and not affiliated with VMware.