Use version catalog to drive java platform (#531)
* Use version catalog to drive Java platform This commit incorporates the use of the Gradle version catalog as well as the related plugins to automatically update the libs.version.toml versions file with updated dependencies. The UpdateProjectVersionPlugin is also updated to modify the spring boot version property in the `libs.versions.toml` versions file rather than gradle.properties. Resolves #523
This commit is contained in:
14
build.gradle
14
build.gradle
@@ -2,14 +2,16 @@ plugins {
|
||||
id 'io.spring.nohttp'
|
||||
id 'org.springframework.pulsar.root-project'
|
||||
id 'org.springframework.pulsar.update-version'
|
||||
id 'org.ajoberstar.grgit' version '4.0.1' apply false
|
||||
alias(libs.plugins.grgit) apply false
|
||||
alias(libs.plugins.versions)
|
||||
alias(libs.plugins.version.catalog.update)
|
||||
}
|
||||
|
||||
description = 'Spring for Apache Pulsar'
|
||||
|
||||
apply from: 'gradle/aggregate-jacoco-report.gradle'
|
||||
apply from: 'gradle/update-copyrights.gradle'
|
||||
|
||||
apply from: 'gradle/version-catalog-update.gradle'
|
||||
|
||||
allprojects {
|
||||
group = 'org.springframework.pulsar'
|
||||
@@ -53,3 +55,11 @@ tasks.register('runAllSampleTests') {
|
||||
allTestsTasks
|
||||
}
|
||||
}
|
||||
|
||||
versionCatalogUpdate {
|
||||
versionCatalogs {
|
||||
buildLibsCatalog {
|
||||
catalogFile = file("gradle/build-libs.versions.toml")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,15 +10,12 @@ repositories {
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
new File(new File("$projectDir").parentFile, "gradle.properties").withInputStream {
|
||||
def properties = new Properties()
|
||||
properties.load(it)
|
||||
ext.set("springFrameworkVersion", properties["springFrameworkVersion"])
|
||||
if (properties["springFrameworkVersion"].contains("-")) {
|
||||
repositories {
|
||||
maven { url "https://repo.spring.io/milestone" }
|
||||
maven { url "https://repo.spring.io/snapshot" }
|
||||
}
|
||||
def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("buildLibs")
|
||||
def springVersion = versionCatalog.findVersion("spring").orElseThrow().displayName
|
||||
if (springVersion.contains("-")) {
|
||||
repositories {
|
||||
maven { url "https://repo.spring.io/milestone" }
|
||||
maven { url "https://repo.spring.io/snapshot" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,24 +35,22 @@ configurations {
|
||||
}
|
||||
}
|
||||
|
||||
ext.set("springFrameworkVersion", "6.0.10")
|
||||
|
||||
dependencies {
|
||||
implementation localGroovy()
|
||||
implementation 'commons-codec:commons-codec:1.15'
|
||||
implementation 'com.fasterxml.jackson.core:jackson-databind:2.11.4'
|
||||
implementation 'io.github.gradle-nexus:publish-plugin:1.3.0'
|
||||
implementation("io.spring.javaformat:spring-javaformat-gradle-plugin:0.0.38")
|
||||
implementation 'io.spring.nohttp:nohttp-gradle:0.0.11'
|
||||
implementation "org.apache.maven:maven-embedder:3.6.3"
|
||||
implementation "org.asciidoctor:asciidoctor-gradle-jvm:3.3.2"
|
||||
implementation 'org.codehaus.groovy:groovy-all:2.5.17'
|
||||
implementation 'org.jfrog.buildinfo:build-info-extractor-gradle:4.31.9'
|
||||
implementation "org.gradle:test-retry-gradle-plugin:1.4.0"
|
||||
implementation 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1'
|
||||
implementation(platform("org.springframework:spring-framework-bom:${springFrameworkVersion}"))
|
||||
implementation 'org.springframework:spring-core'
|
||||
implementation 'org.springframework:spring-web'
|
||||
implementation buildLibs.asciidoc.gradle.jvm
|
||||
implementation buildLibs.commons.codec
|
||||
implementation buildLibs.groovy.all
|
||||
implementation buildLibs.jfrog.build.extractor.gradle
|
||||
implementation buildLibs.jackson.databind
|
||||
implementation buildLibs.javaformat.gradle
|
||||
implementation buildLibs.maven.embedder
|
||||
implementation buildLibs.nexus.publish
|
||||
implementation buildLibs.nohttp.gradle
|
||||
implementation buildLibs.sonarqube.gradle
|
||||
implementation(platform(buildLibs.spring.bom))
|
||||
implementation buildLibs.spring.core
|
||||
implementation buildLibs.spring.web
|
||||
implementation buildLibs.test.retry.gradle
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
|
||||
@@ -4,3 +4,11 @@ pluginManagement {
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
versionCatalogs {
|
||||
buildLibs {
|
||||
from(files("../gradle/build-libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.gradle.api.plugins.JavaPlugin;
|
||||
import org.gradle.api.plugins.PluginManager;
|
||||
|
||||
import org.springframework.pulsar.gradle.optional.OptionalDependenciesPlugin;
|
||||
import org.springframework.pulsar.gradle.publish.SpringMavenPlugin;
|
||||
|
||||
import io.spring.gradle.convention.RepositoryConventionPlugin;
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ public class JavaConventionsPlugin implements Plugin<Project> {
|
||||
project.getTasks().withType(Format.class, (Format) -> Format.setEncoding("UTF-8"));
|
||||
project.getPlugins().apply(CheckstylePlugin.class);
|
||||
CheckstyleExtension checkstyle = project.getExtensions().getByType(CheckstyleExtension.class);
|
||||
checkstyle.setToolVersion("8.45.1");
|
||||
checkstyle.setToolVersion("10.12.4");
|
||||
checkstyle.getConfigDirectory().set(project.getRootProject().file("src/checkstyle"));
|
||||
String version = SpringJavaFormatPlugin.class.getPackage().getImplementationVersion();
|
||||
DependencySet checkstyleDependencies = project.getConfigurations().getByName("checkstyle").getDependencies();
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.springframework.pulsar.gradle.check;
|
||||
|
||||
import org.gradle.api.Plugin;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.VersionCatalogsExtension;
|
||||
import org.gradle.api.plugins.JavaPlugin;
|
||||
import org.gradle.api.tasks.testing.Test;
|
||||
import org.gradle.testing.jacoco.plugins.JacocoPlugin;
|
||||
@@ -19,8 +20,10 @@ public class JacocoConventionsPlugin implements Plugin<Project> {
|
||||
public void apply(final Project project) {
|
||||
project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> {
|
||||
project.getPluginManager().apply(JacocoPlugin.class);
|
||||
VersionCatalogsExtension catalog = project.getExtensions().getByType(VersionCatalogsExtension.class);
|
||||
String jacocoVeresion = catalog.named("libs").findVersion("jacoco").orElseThrow().getDisplayName();
|
||||
project.getExtensions().configure(JacocoPluginExtension.class,
|
||||
(jacocoExtension) -> jacocoExtension.setToolVersion("0.8.9"));
|
||||
(jacocoExtension) -> jacocoExtension.setToolVersion(jacocoVeresion));
|
||||
project.getTasks().withType(Test.class, (test) ->
|
||||
project.getTasks().withType(JacocoReport.class, test::finalizedBy));
|
||||
});
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
package org.springframework.pulsar.gradle.versions;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.gradle.api.DefaultTask;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.VersionCatalogsExtension;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
@@ -31,36 +31,43 @@ public abstract class UpdateProjectVersionTask extends DefaultTask {
|
||||
|
||||
static final String VERSION_PROPERTY = "version";
|
||||
|
||||
static final String SPRING_BOOT_VERSION_PROPERTY = "springBootVersionForDocs";
|
||||
static final String SPRING_BOOT_VERSION_PROPERTY = "spring-boot-for-docs";
|
||||
|
||||
static final Pattern VERSION_PATTERN = Pattern.compile("^([0-9]+)\\.([0-9]+)\\.([0-9]+)(-M\\d+|-RC\\d+|-SNAPSHOT)?$");
|
||||
|
||||
protected void updateVersionInGradleProperties(String newVersion) {
|
||||
this.updatePropertyInGradleProperties(VERSION_PROPERTY, (p) -> p.getVersion().toString(), newVersion);
|
||||
this.updatePropertyInFile(Project.GRADLE_PROPERTIES, VERSION_PROPERTY,
|
||||
(p) -> p.getVersion().toString(),
|
||||
(__) -> newVersion,
|
||||
(currentValue) -> "%s=%s".formatted(VERSION_PROPERTY, currentValue),
|
||||
(__) -> "%s=%s".formatted(VERSION_PROPERTY, newVersion));
|
||||
}
|
||||
|
||||
protected void updatePropertyInGradleProperties(String propertyName, String newPropertyValue) {
|
||||
this.updatePropertyInGradleProperties(propertyName,
|
||||
(p) -> Objects.toString(p.findProperty(propertyName), ""), newPropertyValue);
|
||||
protected void updateVersionInTomlVersions(String versionPropertyName,
|
||||
Function<String, String> newPropertyValueGivenCurrentValue) {
|
||||
this.updatePropertyInFile("gradle/libs.versions.toml", versionPropertyName,
|
||||
(p) -> currentVersionForProperty(p, versionPropertyName),
|
||||
newPropertyValueGivenCurrentValue,
|
||||
(currentValue) -> "%s = \"%s\"".formatted(versionPropertyName, currentValue),
|
||||
(newValue) -> "%s = \"%s\"".formatted(versionPropertyName, newValue));
|
||||
}
|
||||
|
||||
protected void updatePropertyInGradleProperties(
|
||||
String propertyName,
|
||||
Function<Project, String> currentPropertyValueFromProject,
|
||||
String newPropertyValue) {
|
||||
String currentPropertyValue = currentPropertyValueFromProject.apply(getProject());
|
||||
File gradlePropertiesFile = getProject().getRootProject().file(Project.GRADLE_PROPERTIES);
|
||||
if (!gradlePropertiesFile.exists()) {
|
||||
throw new RuntimeException("No gradle.properties to update property in");
|
||||
protected void updatePropertyInFile(String propertyFile, String propertyName,
|
||||
Function<Project, String> currentPropertyValueGivenProject,
|
||||
Function<String, String> newPropertyValueGivenCurrentValue,
|
||||
Function<String, String> expectedCurrentPropertyEntryInFile,
|
||||
Function<String, String> newPropertyEntryInFile) {
|
||||
File file = getProject().getRootProject().file(propertyFile);
|
||||
if (!file.exists()) {
|
||||
throw new RuntimeException("File not found at " + propertyFile);
|
||||
}
|
||||
System.out.printf("Updating the %s property in %s from %s to %s%n",
|
||||
propertyName, Project.GRADLE_PROPERTIES, currentPropertyValue, newPropertyValue);
|
||||
FileUtils.replaceFileText(gradlePropertiesFile, (gradlePropertiesText) -> {
|
||||
gradlePropertiesText = gradlePropertiesText.replace(
|
||||
"%s=%s".formatted(propertyName, currentPropertyValue),
|
||||
"%s=%s".formatted(propertyName, newPropertyValue));
|
||||
return gradlePropertiesText;
|
||||
});
|
||||
String currentValue = currentPropertyValueGivenProject.apply(getProject());
|
||||
String newValue = newPropertyValueGivenCurrentValue.apply(currentValue);
|
||||
System.out.printf("Updating the %s property in %s from %s to %s%n", propertyName,
|
||||
propertyFile, currentValue, newValue);
|
||||
FileUtils.replaceFileText(file, (propertiesText) -> propertiesText.replace(
|
||||
expectedCurrentPropertyEntryInFile.apply(currentValue),
|
||||
newPropertyEntryInFile.apply(newValue)));
|
||||
}
|
||||
|
||||
protected VersionInfo parseVersion(String version) {
|
||||
@@ -78,6 +85,13 @@ public abstract class UpdateProjectVersionTask extends DefaultTask {
|
||||
}
|
||||
}
|
||||
|
||||
protected String currentVersionForProperty(Project project, String versionProperty) {
|
||||
VersionCatalogsExtension catalog = project.getExtensions().getByType(VersionCatalogsExtension.class);
|
||||
return catalog.named("libs").findVersion(versionProperty)
|
||||
.orElseThrow(() -> new IllegalStateException("% property not found".formatted(versionProperty)))
|
||||
.getDisplayName();
|
||||
}
|
||||
|
||||
record VersionInfo(String major, String minor, String patch, @Nullable String modifier) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2022 the original author or authors.
|
||||
* Copyright 2019-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,13 +16,9 @@
|
||||
|
||||
package org.springframework.pulsar.gradle.versions;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.gradle.api.tasks.Input;
|
||||
import org.gradle.api.tasks.TaskAction;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
public abstract class UpdateToReleaseVersionTask extends UpdateProjectVersionTask {
|
||||
|
||||
@Input
|
||||
@@ -31,7 +27,7 @@ public abstract class UpdateToReleaseVersionTask extends UpdateProjectVersionTas
|
||||
@TaskAction
|
||||
public void updateToReleaseVersion() {
|
||||
updateVersionInGradleProperties(this.releaseVersion);
|
||||
updatePropertyInGradleProperties(SPRING_BOOT_VERSION_PROPERTY, calculateReleaseBootVersion());
|
||||
updateVersionInTomlVersions(SPRING_BOOT_VERSION_PROPERTY, this::calculateReleaseBootVersion);
|
||||
}
|
||||
|
||||
public String getReleaseVersion() {
|
||||
@@ -42,9 +38,7 @@ public abstract class UpdateToReleaseVersionTask extends UpdateProjectVersionTas
|
||||
this.releaseVersion = releaseVersion;
|
||||
}
|
||||
|
||||
private String calculateReleaseBootVersion() {
|
||||
String currentBootVersion = Objects.toString(getProject().findProperty(SPRING_BOOT_VERSION_PROPERTY), null);
|
||||
Assert.notNull(currentBootVersion, () -> "% property not found".formatted(SPRING_BOOT_VERSION_PROPERTY));
|
||||
private String calculateReleaseBootVersion(String currentBootVersion) {
|
||||
VersionInfo bootVersionSegments = parseVersion(currentBootVersion);
|
||||
String releaseBootVersion = "%s.%s.%s".formatted(bootVersionSegments.major(), bootVersionSegments.minor(), bootVersionSegments.patch());
|
||||
String releaseVersionModifier = parseVersion(this.releaseVersion).modifier();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2022 the original author or authors.
|
||||
* Copyright 2019-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,21 +16,15 @@
|
||||
|
||||
package org.springframework.pulsar.gradle.versions;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.gradle.api.tasks.TaskAction;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
public abstract class UpdateToSnapshotVersionTask extends UpdateProjectVersionTask {
|
||||
|
||||
@TaskAction
|
||||
public void updateToSnapshotVersion() {
|
||||
String currentVersion = getProject().getVersion().toString();
|
||||
updateVersionInGradleProperties(calculateNextSnapshotVersion(currentVersion));
|
||||
String currentBootVersion = Objects.toString(getProject().findProperty(SPRING_BOOT_VERSION_PROPERTY), null);
|
||||
Assert.notNull(currentBootVersion, () -> "% property not found".formatted(SPRING_BOOT_VERSION_PROPERTY));
|
||||
updatePropertyInGradleProperties(SPRING_BOOT_VERSION_PROPERTY, calculateNextSnapshotVersion(currentBootVersion));
|
||||
updateVersionInTomlVersions(SPRING_BOOT_VERSION_PROPERTY, this::calculateNextSnapshotVersion);
|
||||
}
|
||||
|
||||
private String calculateNextSnapshotVersion(String version) {
|
||||
@@ -45,12 +39,4 @@ public abstract class UpdateToSnapshotVersionTask extends UpdateProjectVersionTa
|
||||
}
|
||||
return "%s.%s.%s-SNAPSHOT".formatted(majorSegment, minorSegment, patchSegment);
|
||||
}
|
||||
|
||||
private String calculateCurrentSnapshotVersion(String version) {
|
||||
VersionInfo versionSegments = parseVersion(version);
|
||||
String majorSegment = versionSegments.major();
|
||||
String minorSegment = versionSegments.minor();
|
||||
String patchSegment = versionSegments.patch();
|
||||
return "%s.%s.%s-SNAPSHOT".formatted(majorSegment, minorSegment, patchSegment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,15 +3,3 @@ version=1.0.2-SNAPSHOT
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -Dfile.encoding=UTF-8
|
||||
|
||||
pulsarClientVersion=3.1.1
|
||||
pulsarClientReactiveVersion=0.5.1
|
||||
springFrameworkVersion=6.1.2
|
||||
|
||||
# only used by integration tests and samples (unpublished deps)
|
||||
springBootVersion=3.2.2-SNAPSHOT
|
||||
|
||||
# only used for docs (links)
|
||||
springBootVersionForDocs=3.2.2-SNAPSHOT
|
||||
|
||||
springCloudStreamVersion=4.1.0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
apply plugin: 'jacoco'
|
||||
|
||||
jacoco {
|
||||
toolVersion '0.8.9'
|
||||
toolVersion libs.versions.jacoco.get()
|
||||
}
|
||||
|
||||
tasks.withType(Test) {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//file:noinspection GroovyUnusedAssignment
|
||||
node {
|
||||
version = '16.16.0'
|
||||
}
|
||||
@@ -36,11 +37,17 @@ tasks.create('generateAntoraResources') {
|
||||
}
|
||||
|
||||
def generateAttributes() {
|
||||
return ['spring-boot-version': project.springBootVersionForDocs ?: 'current',
|
||||
'spring-framework-version': project.springFrameworkVersion ?: 'current',
|
||||
'spring-cloud-stream-version': project.springCloudStreamVersion ?: 'current',
|
||||
'spring-pulsar-version': project.version,
|
||||
'pulsar-client-version': project.pulsarClientVersion ?: 'current',
|
||||
'pulsar-client-reactive-version': project.pulsarClientReactiveVersion ?: 'current',
|
||||
'is-snapshot-version': project.version.endsWith("-SNAPSHOT")]
|
||||
def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
|
||||
def springBootVersionForDocs = versionCatalog.findVersion("spring-boot-for-docs").orElseThrow().displayName
|
||||
def springFrameworkVersion = versionCatalog.findVersion("spring").orElseThrow().displayName
|
||||
def springCloudStreamVersion = versionCatalog.findVersion("spring-cloud-stream").orElseThrow().displayName
|
||||
def pulsarClientVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
|
||||
def pulsarClientReactiveVersion = versionCatalog.findVersion("pulsar-reactive").orElseThrow().displayName
|
||||
return ['is-snapshot-version': project.version.endsWith("-SNAPSHOT"),
|
||||
'pulsar-client-version': pulsarClientVersion ?: 'current',
|
||||
'pulsar-client-reactive-version': pulsarClientReactiveVersion ?: 'current',
|
||||
'spring-boot-version': springBootVersionForDocs ?: 'current',
|
||||
'spring-cloud-stream-version': springCloudStreamVersion ?: 'current',
|
||||
'spring-framework-version': springFrameworkVersion ?: 'current',
|
||||
'spring-pulsar-version': project.version]
|
||||
}
|
||||
|
||||
33
gradle/build-libs.versions.toml
Normal file
33
gradle/build-libs.versions.toml
Normal file
@@ -0,0 +1,33 @@
|
||||
[versions]
|
||||
asciidoc-gradle = "3.3.2"
|
||||
commons-codec = "1.16.0"
|
||||
groovy = "2.5.17"
|
||||
jackson = "2.15.3"
|
||||
javaformat = "0.0.40"
|
||||
jfrog = "4.31.9"
|
||||
maven = "3.6.3"
|
||||
nexus-publish = "1.3.0"
|
||||
nohttp = "0.0.11"
|
||||
sonarqube = "2.7.1"
|
||||
spring = "6.1.2"
|
||||
test-retry = "1.4.0"
|
||||
versions = "0.50.0"
|
||||
version-catalog-update = "0.8.1"
|
||||
|
||||
[libraries]
|
||||
asciidoc-gradle-jvm = { module = "org.asciidoctor:asciidoctor-gradle-jvm", version.ref = "asciidoc-gradle" }
|
||||
commons-codec = { module = "commons-codec:commons-codec", version.ref = "commons-codec" }
|
||||
groovy-all = { module = "org.codehaus.groovy:groovy-all", version.ref = "groovy" }
|
||||
jackson-bom = { module = "com.fasterxml.jackson:jackson-bom", version.ref = "jackson" }
|
||||
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
|
||||
javaformat-checkstyle = { module = "io.spring.javaformat:spring-javaformat-checkstyle", version.ref = "javaformat" }
|
||||
javaformat-gradle = { module = "io.spring.javaformat:spring-javaformat-gradle-plugin", version.ref = "javaformat" }
|
||||
jfrog-build-extractor-gradle = { module = "org.jfrog.buildinfo:build-info-extractor-gradle", version.ref = "jfrog" }
|
||||
maven-embedder = { module = "org.apache.maven:maven-embedder", version.ref = "maven" }
|
||||
nexus-publish = { module = "io.github.gradle-nexus:publish-plugin", version.ref = "nexus-publish" }
|
||||
nohttp-gradle = { module = "io.spring.nohttp:nohttp-gradle", version.ref = "nohttp" }
|
||||
sonarqube-gradle = { module = "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin", version.ref = "sonarqube" }
|
||||
spring-bom = { module = "org.springframework:spring-framework-bom", version.ref = "spring" }
|
||||
spring-core = { module = "org.springframework:spring-core", version.ref = "spring" }
|
||||
spring-web = { module = "org.springframework:spring-web", version.ref = "spring" }
|
||||
test-retry-gradle = { module = "org.gradle:test-retry-gradle-plugin", version.ref = "test-retry" }
|
||||
90
gradle/libs.versions.toml
Normal file
90
gradle/libs.versions.toml
Normal file
@@ -0,0 +1,90 @@
|
||||
[versions]
|
||||
# product
|
||||
brave = "5.16.0"
|
||||
caffeine = "3.1.8"
|
||||
commons-codec = "1.16.0"
|
||||
jackson = "2.15.3"
|
||||
jsr305 = "3.0.2"
|
||||
logback = "1.4.14"
|
||||
log4j = "2.17.1"
|
||||
micrometer = "1.12.1"
|
||||
micrometer-docs-gen = "1.0.0"
|
||||
micrometer-tracing = "1.2.1"
|
||||
protobuf = "3.21.5"
|
||||
pulsar = "3.1.1"
|
||||
pulsar-reactive = "0.5.1"
|
||||
reactor = "2023.0.1"
|
||||
spring = "6.1.2"
|
||||
# tests
|
||||
assertj = "3.24.2"
|
||||
awaitility = "4.2.0"
|
||||
jacoco = "0.8.9"
|
||||
json-path = "2.8.0"
|
||||
junit = "5.10.1"
|
||||
hamcrest = "2.1"
|
||||
mockito = "5.7.0"
|
||||
spring-dep-mgmt = "1.1.4"
|
||||
spring-boot = "3.2.2-SNAPSHOT"
|
||||
spring-boot-for-docs = "3.2.2-SNAPSHOT"
|
||||
spring-cloud-stream = "4.1.0"
|
||||
spring-retry = "2.0.5"
|
||||
system-lambda = "1.2.1"
|
||||
testcontainers = "1.19.3"
|
||||
# plugins
|
||||
antora = "1.0.0"
|
||||
antora-yml = "0.0.1"
|
||||
download = "5.3.0"
|
||||
grgit = "4.0.1"
|
||||
nohttp = "0.0.11"
|
||||
shadow = "7.1.2"
|
||||
versions = "0.50.0"
|
||||
version-catalog-update = "0.8.1"
|
||||
|
||||
[libraries]
|
||||
# Product libs
|
||||
brave-bom = { module = "io.zipkin.brave:brave-bom", version.ref = "brave" }
|
||||
caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version.ref = "caffeine" }
|
||||
commons-codec = { module = "commons-codec:commons-codec", version.ref = "commons-codec" }
|
||||
jackson-bom = { module = "com.fasterxml.jackson:jackson-bom", version.ref = "jackson" }
|
||||
jsr305 = { module = "com.google.code.findbugs:jsr305", version.ref = "jsr305" }
|
||||
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
|
||||
log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" }
|
||||
micrometer-bom = { module = "io.micrometer:micrometer-bom", version.ref = "micrometer" }
|
||||
micrometer-docs-gen = { module = "io.micrometer:micrometer-docs-generator", version.ref = "micrometer-docs-gen" }
|
||||
micrometer-tracing-bom = { module = "io.micrometer:micrometer-tracing-bom", version.ref = "micrometer-tracing" }
|
||||
protobuf-java = { module = "com.google.protobuf:protobuf-java", version.ref = "protobuf" }
|
||||
pulsar-client-all = { module = "org.apache.pulsar:pulsar-client-all", version.ref = "pulsar" }
|
||||
pulsar-client-reactive-adapter = { module = "org.apache.pulsar:pulsar-client-reactive-adapter", version.ref = "pulsar-reactive" }
|
||||
pulsar-client-reactive-producer-cache-caffeine-shaded = { module = "org.apache.pulsar:pulsar-client-reactive-producer-cache-caffeine-shaded", version.ref = "pulsar-reactive" }
|
||||
pulsar-functions-api = { module = "org.apache.pulsar:pulsar-functions-api", version.ref = "pulsar" }
|
||||
reactor-bom = { module = "io.projectreactor:reactor-bom", version.ref = "reactor" }
|
||||
spring-bom = { module = "org.springframework:spring-framework-bom", version.ref = "spring" }
|
||||
spring-retry = { module = "org.springframework.retry:spring-retry", version.ref = "spring-retry" }
|
||||
# Testing libs
|
||||
assertj-bom = { module = "org.assertj:assertj-bom", version.ref = "assertj" }
|
||||
awaitility = { module = "org.awaitility:awaitility", version.ref = "awaitility" }
|
||||
hamcrest = { module = "org.hamcrest:hamcrest", version.ref = "hamcrest" }
|
||||
json-path = { module = "com.jayway.jsonpath:json-path", version.ref = "json-path" }
|
||||
junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" }
|
||||
mockito-bom = { module = "org.mockito:mockito-bom", version.ref = "mockito" }
|
||||
spring-boot-starter-amqp = { module = "org.springframework.boot:spring-boot-starter-amqp", version.ref = "spring-boot" }
|
||||
spring-boot-starter-pulsar = { module = "org.springframework.boot:spring-boot-starter-pulsar", version.ref = "spring-boot" }
|
||||
spring-boot-starter-pulsar-reactive = { module = "org.springframework.boot:spring-boot-starter-pulsar-reactive", version.ref = "spring-boot" }
|
||||
spring-boot-starter-test = { module = "org.springframework.boot:spring-boot-starter-test", version.ref = "spring-boot" }
|
||||
spring-boot-testcontainers = { module = "org.springframework.boot:spring-boot-testcontainers", version.ref = "spring-boot" }
|
||||
spring-test = { module = "org.springframework:spring-test", version.ref = "spring" }
|
||||
system-lambda = { module = "com.github.stefanbirkner:system-lambda", version.ref = "system-lambda" }
|
||||
testcontainers-bom = { module = "org.testcontainers:testcontainers-bom", version.ref = "testcontainers" }
|
||||
testcontainers-junit-jupiter = { module = "org.testcontainers:junit-jupiter", version.ref = "testcontainers" }
|
||||
|
||||
[plugins]
|
||||
antora = { id = "org.antora", version.ref = "antora" }
|
||||
antora-yml = { id = "io.spring.antora.generate-antora-yml", version.ref = "antora-yml" }
|
||||
download = { id = "de.undercouch.download", version.ref = "download" }
|
||||
grgit = { id = "org.ajoberstar.grgit", version.ref = "grgit" }
|
||||
nohttp = { id = "io.spring.nohttp", version.ref = "nohttp" }
|
||||
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
|
||||
spring-boot = { id = "org.springframework.boot", version.ref = "spring-boot" }
|
||||
spring-dep-mgmt = { id = "io.spring.dependency-management", version.ref = "spring-dep-mgmt" }
|
||||
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }
|
||||
version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" }
|
||||
44
gradle/version-catalog-update.gradle
Normal file
44
gradle/version-catalog-update.gradle
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
def isNonStable = { String version ->
|
||||
def unstableKeyword = ['alpha', 'beta', 'rc'].any { it -> version.contains(it) }
|
||||
if (unstableKeyword) {
|
||||
return true
|
||||
}
|
||||
def containsStableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
|
||||
def containsStableSuffix = (version ==~ /^[0-9,.v-]+(-r)?$/)
|
||||
return !containsStableKeyword && !containsStableSuffix
|
||||
}
|
||||
|
||||
def trustedLibPrefixes = [
|
||||
"org.springframework.",
|
||||
"io.micrometer.",
|
||||
"io.spring.dependency-management:",
|
||||
"org.apache.pulsar:pulsar-client-reactive",
|
||||
"io.projectreactor:reactor"
|
||||
]
|
||||
|
||||
tasks.named("dependencyUpdates").configure {
|
||||
checkConstraints = true
|
||||
rejectVersionIf {
|
||||
def isTrustedLib = trustedLibPrefixes.any { s -> it.candidate.toString().startsWith(s) }
|
||||
if (isTrustedLib) {
|
||||
def (candidateMajorMinorPatch, candidateMilestone) = it.candidate.version.tokenize('-')
|
||||
def (candidateMajor, candidateMinor, candidatePatch) = candidateMajorMinorPatch.tokenize('.')
|
||||
def (currentMajorMinorPatch, currentMilestone) = it.currentVersion.tokenize('-')
|
||||
def (currentMajor, currentMinor, currentPatch) = currentMajorMinorPatch.tokenize('.')
|
||||
return (candidateMajor.toInteger() < currentMajor.toInteger())
|
||||
|| (candidateMinor.toInteger() < currentMinor.toInteger())
|
||||
|| (candidatePatch.toInteger() < currentPatch.toInteger())
|
||||
}
|
||||
return isNonStable(it.candidate.version)
|
||||
}
|
||||
}
|
||||
|
||||
versionCatalogUpdate {
|
||||
sortByKey = false
|
||||
keep {
|
||||
keepUnusedLibraries = true
|
||||
keepUnusedVersions = true
|
||||
keepUnusedPlugins = true
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id 'org.springframework.pulsar.spring-unpublished-module'
|
||||
id "de.undercouch.download" version "5.3.0"
|
||||
id 'spring-pulsar.integration-test-conventions'
|
||||
alias(libs.plugins.download)
|
||||
}
|
||||
|
||||
description = 'Spring Pulsar Integration Tests'
|
||||
@@ -16,17 +16,17 @@ dependencies {
|
||||
intTestImplementation project(':spring-pulsar')
|
||||
intTestImplementation project(':spring-pulsar-reactive')
|
||||
intTestImplementation project(':spring-pulsar-test')
|
||||
intTestRuntimeOnly 'ch.qos.logback:logback-classic'
|
||||
intTestRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||
intTestImplementation 'org.awaitility:awaitility'
|
||||
intTestImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
|
||||
intTestImplementation "org.springframework.boot:spring-boot-starter-amqp:${springBootVersion}"
|
||||
intTestImplementation "org.springframework.boot:spring-boot-starter-pulsar:${springBootVersion}"
|
||||
intTestImplementation "org.springframework.boot:spring-boot-starter-pulsar-reactive:${springBootVersion}"
|
||||
intTestImplementation "org.springframework.boot:spring-boot-testcontainers:${springBootVersion}"
|
||||
intTestImplementation 'org.testcontainers:junit-jupiter'
|
||||
intTestImplementation 'org.testcontainers:pulsar'
|
||||
intTestImplementation 'org.testcontainers:rabbitmq'
|
||||
intTestImplementation libs.spring.boot.starter.test
|
||||
intTestImplementation libs.spring.boot.starter.amqp
|
||||
intTestImplementation libs.spring.boot.starter.pulsar
|
||||
intTestImplementation libs.spring.boot.starter.pulsar.reactive
|
||||
intTestImplementation libs.spring.boot.testcontainers
|
||||
intTestRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||
intTestRuntimeOnly libs.logback.classic
|
||||
}
|
||||
|
||||
test {
|
||||
@@ -37,6 +37,9 @@ integrationTest {
|
||||
maxHeapSize '2048m'
|
||||
}
|
||||
|
||||
def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
|
||||
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
|
||||
|
||||
task downloadRabbitConnector {
|
||||
onlyIf {
|
||||
System.getProperty("downloadRabbitConnector") == "true"
|
||||
@@ -45,8 +48,8 @@ task downloadRabbitConnector {
|
||||
try {
|
||||
download.run {
|
||||
println "Downloading Rabbit connector to 'src/intTest/resources/connectors/' (one time only if not already downloaded)..."
|
||||
src 'https://archive.apache.org/dist/pulsar/pulsar-3.1.1/connectors/pulsar-io-rabbitmq-3.1.1.nar'
|
||||
dest "$buildDir/../src/intTest/resources/connectors/pulsar-io-rabbitmq-3.1.1.nar"
|
||||
src "https://archive.apache.org/dist/pulsar/pulsar-${pulsarVersion}/connectors/pulsar-io-rabbitmq-${pulsarVersion}.nar"
|
||||
dest "$buildDir/../src/intTest/resources/connectors/pulsar-io-rabbitmq-${pulsarVersion}.nar"
|
||||
overwrite false
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
plugins {
|
||||
id 'org.springframework.pulsar.spring-module'
|
||||
id 'com.github.johnrengelman.shadow' version '7.1.2'
|
||||
alias(libs.plugins.shadow)
|
||||
}
|
||||
|
||||
description = 'Spring Pulsar Caffeine Cache Provider'
|
||||
|
||||
dependencies {
|
||||
api project (':spring-pulsar-cache-provider')
|
||||
implementation 'com.github.ben-manes.caffeine:caffeine'
|
||||
implementation libs.caffeine
|
||||
shadow project(':spring-pulsar-cache-provider')
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
plugins {
|
||||
id 'java-platform'
|
||||
id 'io.spring.convention.repository'
|
||||
}
|
||||
|
||||
javaPlatform {
|
||||
@@ -7,27 +8,29 @@ javaPlatform {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api platform("com.fasterxml.jackson:jackson-bom:2.15.3")
|
||||
api platform("io.micrometer:micrometer-bom:1.12.1")
|
||||
api platform("io.micrometer:micrometer-tracing-bom:1.2.1")
|
||||
api platform("io.projectreactor:reactor-bom:2023.0.1")
|
||||
api platform("io.zipkin.brave:brave-bom:5.16.0")
|
||||
api platform("org.assertj:assertj-bom:3.24.2")
|
||||
api platform("org.awaitility:awaitility:4.2.0")
|
||||
api platform("org.junit:junit-bom:5.10.1")
|
||||
api platform("org.mockito:mockito-bom:5.7.0")
|
||||
api platform("org.springframework:spring-framework-bom:$springFrameworkVersion")
|
||||
api platform("org.testcontainers:testcontainers-bom:1.19.3")
|
||||
api platform(libs.jackson.bom)
|
||||
api platform(libs.micrometer.bom)
|
||||
api platform(libs.micrometer.tracing.bom)
|
||||
api platform(libs.reactor.bom)
|
||||
api platform(libs.brave.bom)
|
||||
api platform(libs.assertj.bom)
|
||||
api platform(libs.awaitility)
|
||||
api platform(libs.junit.bom)
|
||||
api platform(libs.mockito.bom)
|
||||
api platform(libs.spring.bom)
|
||||
api platform(libs.testcontainers.bom)
|
||||
|
||||
constraints {
|
||||
api "ch.qos.logback:logback-classic:1.4.14"
|
||||
api "com.github.ben-manes.caffeine:caffeine:3.1.8"
|
||||
api "com.google.code.findbugs:jsr305:3.0.2"
|
||||
api "com.google.protobuf:protobuf-java:3.21.5"
|
||||
api "com.jayway.jsonpath:json-path:2.8.0"
|
||||
api "org.apache.pulsar:pulsar-client-all:$pulsarClientVersion"
|
||||
api "org.apache.pulsar:pulsar-client-reactive-adapter:$pulsarClientReactiveVersion"
|
||||
api "org.apache.pulsar:pulsar-client-reactive-producer-cache-caffeine-shaded:$pulsarClientReactiveVersion"
|
||||
api "org.springframework.retry:spring-retry:2.0.5"
|
||||
api libs.logback.classic
|
||||
api libs.caffeine
|
||||
api libs.jsr305
|
||||
api libs.protobuf.java
|
||||
api libs.json.path
|
||||
api libs.micrometer.docs.gen
|
||||
api libs.pulsar.client.all
|
||||
api libs.pulsar.client.reactive.adapter
|
||||
api libs.pulsar.client.reactive.producer.cache.caffeine.shaded
|
||||
api libs.spring.retry
|
||||
api libs.system.lambda
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,20 @@
|
||||
plugins {
|
||||
id 'org.springframework.pulsar.spring-docs-module'
|
||||
id 'org.antora' version '1.0.0'
|
||||
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
|
||||
alias(libs.plugins.antora)
|
||||
alias(libs.plugins.antora.yml)
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/gradle/antora-docs.gradle"
|
||||
|
||||
description = 'Spring for Apache Pulsar Docs'
|
||||
|
||||
ext {
|
||||
micrometerDocsVersion="1.0.0"
|
||||
}
|
||||
|
||||
configurations {
|
||||
observationDocs
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api project (':spring-pulsar')
|
||||
observationDocs "io.micrometer:micrometer-docs-generator:$micrometerDocsVersion"
|
||||
observationDocs libs.micrometer.docs.gen
|
||||
}
|
||||
|
||||
jar {
|
||||
|
||||
@@ -6,27 +6,27 @@ description = 'Spring Pulsar Reactive Support'
|
||||
|
||||
dependencies {
|
||||
api project (':spring-pulsar')
|
||||
api ('org.apache.pulsar:pulsar-client-reactive-adapter') {
|
||||
api (libs.pulsar.client.reactive.adapter) {
|
||||
// spring-pulsar includes a pulsar-client with its unwanted transitive deps excluded
|
||||
exclude group: "org.apache.pulsar", module: "pulsar-client"
|
||||
}
|
||||
api("org.apache.pulsar:pulsar-client-reactive-producer-cache-caffeine-shaded") {
|
||||
api(libs.pulsar.client.reactive.producer.cache.caffeine.shaded) {
|
||||
// (above) we include a pulsar-client-reactive-adapter whose pulsar-client with
|
||||
// unwanted transitive deps excluded
|
||||
exclude group: "org.apache.pulsar", module: "pulsar-client-reactive-adapter"
|
||||
}
|
||||
implementation 'com.fasterxml.jackson.core:jackson-core'
|
||||
implementation 'com.fasterxml.jackson.core:jackson-databind'
|
||||
implementation 'com.google.code.findbugs:jsr305'
|
||||
implementation libs.jsr305
|
||||
optional 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
|
||||
optional 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
|
||||
optional 'com.fasterxml.jackson.datatype:jackson-datatype-joda'
|
||||
optional 'com.google.protobuf:protobuf-java'
|
||||
optional 'com.jayway.jsonpath:json-path'
|
||||
optional 'io.projectreactor:reactor-core'
|
||||
optional libs.protobuf.java
|
||||
optional libs.json.path
|
||||
|
||||
testImplementation project(':spring-pulsar-test')
|
||||
testRuntimeOnly 'ch.qos.logback:logback-classic'
|
||||
testRuntimeOnly libs.logback.classic
|
||||
testImplementation 'io.projectreactor:reactor-test'
|
||||
testImplementation 'org.assertj:assertj-core'
|
||||
testImplementation 'org.awaitility:awaitility'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.2.2-SNAPSHOT'
|
||||
id 'io.spring.dependency-management' version '1.1.4'
|
||||
alias(libs.plugins.spring.boot)
|
||||
alias(libs.plugins.spring.dep.mgmt)
|
||||
}
|
||||
|
||||
description = 'Spring Pulsar Sample (Custom Routing w/ Failover)'
|
||||
@@ -12,7 +12,11 @@ repositories {
|
||||
maven { url 'https://repo.spring.io/snapshot' }
|
||||
}
|
||||
|
||||
ext['spring-pulsar.version'] = '${project.version}'
|
||||
def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
|
||||
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
|
||||
|
||||
ext['spring-pulsar.version'] = "${project.version}"
|
||||
ext['pulsar.version'] = "${pulsarVersion}"
|
||||
|
||||
dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-pulsar'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.2.2-SNAPSHOT'
|
||||
id 'io.spring.dependency-management' version '1.1.4'
|
||||
alias(libs.plugins.spring.boot)
|
||||
alias(libs.plugins.spring.dep.mgmt)
|
||||
}
|
||||
|
||||
description = 'Spring Pulsar Sample (Imperative Produce and Consume)'
|
||||
@@ -12,7 +12,11 @@ repositories {
|
||||
maven { url 'https://repo.spring.io/snapshot' }
|
||||
}
|
||||
|
||||
ext['spring-pulsar.version'] = '${project.version}'
|
||||
def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
|
||||
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
|
||||
|
||||
ext['spring-pulsar.version'] = "${project.version}"
|
||||
ext['pulsar.version'] = "${pulsarVersion}"
|
||||
|
||||
dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-pulsar'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.2.2-SNAPSHOT'
|
||||
id 'io.spring.dependency-management' version '1.1.4'
|
||||
alias(libs.plugins.spring.boot)
|
||||
alias(libs.plugins.spring.dep.mgmt)
|
||||
}
|
||||
|
||||
description = 'Spring Cloud Stream Binder for Pulsar Sample Application'
|
||||
@@ -12,8 +12,15 @@ repositories {
|
||||
maven { url 'https://repo.spring.io/snapshot' }
|
||||
}
|
||||
|
||||
def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
|
||||
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
|
||||
def springCloudStreamVersion = versionCatalog.findVersion("spring-cloud-stream").orElseThrow().displayName
|
||||
|
||||
ext['spring-pulsar.version'] = "${project.version}"
|
||||
ext['pulsar.version'] = "${pulsarVersion}"
|
||||
|
||||
dependencies {
|
||||
implementation "org.springframework.boot:spring-boot-starter-pulsar:${springBootVersion}"
|
||||
implementation "org.springframework.boot:spring-boot-starter-pulsar"
|
||||
implementation "org.springframework.cloud:spring-cloud-stream-binder-pulsar:${springCloudStreamVersion}"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.2.2-SNAPSHOT'
|
||||
id 'io.spring.dependency-management' version '1.1.4'
|
||||
alias(libs.plugins.spring.boot)
|
||||
alias(libs.plugins.spring.dep.mgmt)
|
||||
}
|
||||
|
||||
group = 'org.springframework.pulsar.sample'
|
||||
@@ -13,9 +13,16 @@ repositories {
|
||||
maven { url 'https://repo.spring.io/snapshot' }
|
||||
}
|
||||
|
||||
def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
|
||||
def springCloudStreamVersion = versionCatalog.findVersion("spring-cloud-stream").orElseThrow().displayName
|
||||
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
|
||||
|
||||
ext['spring-pulsar.version'] = "${project.version}"
|
||||
ext['pulsar.version'] = "${pulsarVersion}"
|
||||
|
||||
dependencies {
|
||||
implementation "org.springframework.cloud:spring-cloud-stream-binder-pulsar:${springCloudStreamVersion}"
|
||||
implementation "org.springframework.boot:spring-boot-starter-pulsar:${springBootVersion}"
|
||||
implementation "org.springframework.boot:spring-boot-starter-pulsar"
|
||||
implementation 'org.springframework.boot:spring-boot-starter-amqp'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-cassandra'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
||||
|
||||
@@ -10,9 +10,12 @@ repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
|
||||
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
|
||||
|
||||
dependencies {
|
||||
implementation 'org.apache.pulsar:pulsar-client-all:3.1.1'
|
||||
implementation 'org.apache.pulsar:pulsar-functions-api:3.1.1'
|
||||
implementation "org.apache.pulsar:pulsar-client-all:${pulsarVersion}"
|
||||
implementation "org.apache.pulsar:pulsar-functions-api:${pulsarVersion}"
|
||||
compileOnly 'org.projectlombok:lombok:1.18.24'
|
||||
annotationProcessor 'org.projectlombok:lombok:1.18.24'
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.2.2-SNAPSHOT'
|
||||
id 'io.spring.dependency-management' version '1.1.4'
|
||||
alias(libs.plugins.spring.boot)
|
||||
alias(libs.plugins.spring.dep.mgmt)
|
||||
}
|
||||
|
||||
description = 'Spring Pulsar Sample Application (Reader)'
|
||||
@@ -12,8 +12,14 @@ repositories {
|
||||
maven { url 'https://repo.spring.io/snapshot' }
|
||||
}
|
||||
|
||||
def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
|
||||
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
|
||||
|
||||
ext['spring-pulsar.version'] = "${project.version}"
|
||||
ext['pulsar.version'] = "${pulsarVersion}"
|
||||
|
||||
dependencies {
|
||||
implementation "org.springframework.boot:spring-boot-starter-pulsar:${springBootVersion}"
|
||||
implementation "org.springframework.boot:spring-boot-starter-pulsar"
|
||||
}
|
||||
|
||||
test {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.2.2-SNAPSHOT'
|
||||
id 'io.spring.dependency-management' version '1.1.4'
|
||||
alias(libs.plugins.spring.boot)
|
||||
alias(libs.plugins.spring.dep.mgmt)
|
||||
}
|
||||
|
||||
description = 'Reactive Spring Pulsar Sample Application'
|
||||
@@ -12,8 +12,16 @@ repositories {
|
||||
maven { url 'https://repo.spring.io/snapshot' }
|
||||
}
|
||||
|
||||
def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
|
||||
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
|
||||
def pulsarReactiveVersion = versionCatalog.findVersion("pulsar-reactive").orElseThrow().displayName
|
||||
|
||||
ext['spring-pulsar.version'] = "${project.version}"
|
||||
ext['pulsar.version'] = "${pulsarVersion}"
|
||||
ext['pulsar-reactive.version'] = "${pulsarReactiveVersion}"
|
||||
|
||||
dependencies {
|
||||
implementation "org.springframework.boot:spring-boot-starter-pulsar-reactive:${springBootVersion}"
|
||||
implementation "org.springframework.boot:spring-boot-starter-pulsar-reactive"
|
||||
}
|
||||
|
||||
test {
|
||||
|
||||
@@ -6,7 +6,7 @@ description = 'Spring Pulsar Core'
|
||||
|
||||
dependencies {
|
||||
api 'io.micrometer:micrometer-observation'
|
||||
api ('org.apache.pulsar:pulsar-client-all') {
|
||||
api (libs.pulsar.client.all) {
|
||||
exclude group: 'org.apache.logging.log4j'
|
||||
exclude group: 'com.sun.activation', module: 'javax.activation'
|
||||
exclude group: 'javax.validation', module: 'validation-api'
|
||||
@@ -14,22 +14,21 @@ dependencies {
|
||||
api 'org.springframework:spring-context'
|
||||
api 'org.springframework:spring-messaging'
|
||||
api 'org.springframework:spring-tx'
|
||||
api ('org.springframework.retry:spring-retry') {
|
||||
api (libs.spring.retry) {
|
||||
exclude group: 'org.springframework'
|
||||
}
|
||||
api project(':spring-pulsar-cache-provider')
|
||||
implementation project(path: ':spring-pulsar-cache-provider-caffeine', configuration: 'shadow')
|
||||
implementation 'com.fasterxml.jackson.core:jackson-core'
|
||||
implementation 'com.fasterxml.jackson.core:jackson-databind'
|
||||
implementation 'com.google.code.findbugs:jsr305'
|
||||
implementation libs.jsr305
|
||||
optional libs.protobuf.java
|
||||
optional libs.json.path
|
||||
optional 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
|
||||
optional 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
|
||||
optional 'com.fasterxml.jackson.datatype:jackson-datatype-joda'
|
||||
optional 'com.google.protobuf:protobuf-java'
|
||||
optional 'com.jayway.jsonpath:json-path'
|
||||
|
||||
testImplementation project(':spring-pulsar-test')
|
||||
testRuntimeOnly 'ch.qos.logback:logback-classic'
|
||||
testImplementation 'io.micrometer:micrometer-observation-test'
|
||||
testImplementation 'io.micrometer:micrometer-tracing-bridge-brave'
|
||||
testImplementation 'io.micrometer:micrometer-tracing-test'
|
||||
@@ -40,7 +39,7 @@ dependencies {
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||
testImplementation 'org.mockito:mockito-junit-jupiter'
|
||||
testImplementation 'org.springframework:spring-test'
|
||||
|
||||
// Output capture used by PulsarFunctionAdministrationTests
|
||||
testImplementation group: 'com.github.stefanbirkner', name: 'system-lambda', version: '1.2.1'
|
||||
testImplementation libs.system.lambda
|
||||
testRuntimeOnly libs.logback.classic
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user