You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2026/09/17 07:07:33 UTC

(pulsar) branch master updated: [fix][build] Restore test JAR publications in Gradle (#26622)

This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 2c3133a5bcdc [fix][build] Restore test JAR publications in Gradle (#26622)
2c3133a5bcdc is described below

commit 2c3133a5bcdcf0b36584d6e9ec9c91402142929c
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Thu Sep 17 10:07:26 2026 +0300

    [fix][build] Restore test JAR publications in Gradle (#26622)
---
 build-logic/PUBLISHING.md                                      | 10 ++++++++++
 .../src/main/kotlin/pulsar.publish-conventions.gradle.kts      | 10 ++++++++++
 2 files changed, 20 insertions(+)

diff --git a/build-logic/PUBLISHING.md b/build-logic/PUBLISHING.md
index ae80240571e1..0fbfb655a517 100644
--- a/build-logic/PUBLISHING.md
+++ b/build-logic/PUBLISHING.md
@@ -30,6 +30,13 @@ By default (`publishApiAndSpiOnly` unset or `false`), Gradle publishes the modul
 publishing conventions, including the root `pulsar` parent POM and the full `pulsar-bom`. The
 repository's `gradle.properties` supplies the default group (`org.apache.pulsar`) and version.
 
+As in the `branch-4.2` Maven build, publications for `managed-ledger`, `pulsar-broker`,
+`pulsar-broker-common`, `pulsar-metadata`, and `pulsar-package-core` include a `tests` classifier
+JAR. These test JARs are published in both ordinary and API/SPI mode. In Maven,
+`<type>test-jar</type>` and `<classifier>tests</classifier>` refer to the same test JAR; declare
+only one dependency per module. Test JARs share their module's POM and do not expose its test
+dependencies transitively, so consumers must declare any additional test dependencies they need.
+
 Choose the task for the intended destination:
 
 | Task | Destination | Version requirement |
@@ -222,6 +229,9 @@ client, Pulsar Functions, and Pulsar plugins such as interceptors and additional
 includes the client implementations (including v5), API and service provider interface (SPI)
 libraries, and their transitive Pulsar dependencies.
 
+The selection also includes the `buildtools` JAR and all five test JAR publications described
+above to support external tests.
+
 A typical use case is distributing a custom Pulsar Java client build to your own Maven repository
 so applications can quickly adopt a bug fix or security fix in Pulsar itself. Publishing this subset
 avoids performing a full Pulsar dependency release to that repository. For deploying a custom server
diff --git a/build-logic/conventions/src/main/kotlin/pulsar.publish-conventions.gradle.kts b/build-logic/conventions/src/main/kotlin/pulsar.publish-conventions.gradle.kts
index 253fd5b6ee33..ab6475bb716c 100644
--- a/build-logic/conventions/src/main/kotlin/pulsar.publish-conventions.gradle.kts
+++ b/build-logic/conventions/src/main/kotlin/pulsar.publish-conventions.gradle.kts
@@ -63,6 +63,16 @@ pluginManager.withPlugin("java-library") {
     val mavenPublication = publishing.publications.create<MavenPublication>("maven") {
         artifact(sourcesJar)
         artifact(javadocJar)
+        // Preserve the test JAR publications from the branch-4.2 Maven build in both modes.
+        if (project.path in setOf(
+                ":managed-ledger",
+                ":pulsar-broker",
+                ":pulsar-broker-common",
+                ":pulsar-metadata",
+                ":pulsar-package-management:pulsar-package-core",
+            )) {
+            artifact(tasks.named("testJar"))
+        }
     }
 
     // Shaded modules: the shadow plugin registers components["shadow"] in its own afterEvaluate, so