Repository navigation
[improve][build] Fix publishing of public libraries with correct POM and Gradle module metadata - #26020
Merged
merlimat merged 12 commits intoJun 13, 2026
Conversation
…itory
The pulsar-client-api-v5 and pulsar-client-v5 modules used
pulsar.java-conventions, which does not configure Maven publishing. Because
the published :pulsar-client-tools module depends on them, the publish
validation in pulsar.public-java-library-conventions failed:
Published module ':pulsar-client-tools' depends on unpublished projects:
- implementation -> :pulsar-client-api-v5 (not published)
- implementation -> :pulsar-client-v5 (not published)
Switch both v5 modules to pulsar.public-java-library-conventions so they are
published. Add a mavenPublishLock shared build service that serializes
PublishToMavenRepository uploads (maxParallelUsages = 1) so release uploads
land in a single Nexus staging repository without requiring --no-parallel.
Add a CI step running publishAllPublicationsToLocalDeployRepository to catch
publishing regressions.
Assisted-by: Claude Code (claude-opus-4-8)
…p blanket POM exclusions
Two related fixes to the dependency metadata of published modules.
1. api vs implementation classification
Many modules declared dependencies as `implementation` even though their
types appear in the module's public API (ABI). Gradle maps `implementation`
to `runtime` scope in the published POM (and the runtime-only variant in
Gradle Module Metadata), so consumers could not compile against types the API
exposes. Promote those dependencies to `api` (153 declarations across 34
modules) so they are published with compile scope and the api variant, while
genuinely internal dependencies stay `implementation`. The classification was
produced with ABI analysis (the dependency-analysis Gradle plugin's
buildHealth) rather than by hand.
For example, pulsar-client-original now publishes pulsar-common,
opentelemetry-api, guava, async-http-client, slog, avro and jspecify with
compile scope (they surface through the client API), while netty, gson,
datasketches, RoaringBitmap, etc. remain runtime.
2. Remove blanket dependency exclusions from published POMs
pulsar.java-conventions used `configurations.all { exclude(...) }` to drop
log4j-slf4j-impl and bc-fips. Per-configuration excludes are emitted onto
every dependency of every published POM, producing two <exclusion> entries on
every dependency. Both unwanted artifacts only arrive transitively through
bookkeeper-server, which already has a component-metadata rule stripping its
BouncyCastle. Extend that rule to also drop log4j-slf4j-impl and remove the
two global excludes plus the module-name-based `modulesUsingBcFips` allowlist.
The FIPS modules declare bc-fips directly, so they are unaffected.
Verified: compileJava/compileTestJava, spotlessCheck, checkstyleMain/Test and
publishAllPublicationsToLocalDeployRepository all pass; published POMs no longer
contain the log4j-slf4j-impl/bc-fips exclusions and carry correct dependency
scopes.
Assisted-by: Claude Code (claude-opus-4-8)
…n tests pulsar-common and pulsar-broker-common declared testImplementation(libs.bc.fips), but no test in either module exercises FIPS (FIPS is covered by the dedicated bouncy-castle/bcfips-include-test module). Their testJar configurations extend testImplementation, so bc-fips was re-exported to every downstream module consuming those testJars (pulsar-proxy, pulsar-client-tools-test, tests:integration, ...), which also carry the non-FIPS bcprov-jdk18on. Both jars define org.bouncycastle.* with different signers, so the JVM threw "class org.bouncycastle.crypto.CryptoServicesRegistrar's signer information does not match signer information of other classes in the same package" when SecurityUtility loaded the non-FIPS BouncyCastleProvider in its static initializer, failing the Proxy, Messaging, Kubernetes and client-tools jobs. The blanket exclusion removed in the previous commit had been masking this leak. Replace bc-fips with the non-FIPS bcprov-jdk18on (the provider SecurityUtility prefers in production), so FIPS and non-FIPS BouncyCastle never share a classpath, without reintroducing the per-POM <exclusion> pollution. Verified locally: DefaultPulsarSslFactoryTest, SslContextTest, JettySslContextFactoryTest, ProxyAuthenticatedProducerConsumerTest and the FIPS TlsProducerConsumerTest all pass; dependencyInsight confirms bc-fips is off every non-FIPS test classpath and bcfips-include-test stays FIPS-only. Assisted-by: Claude Code (claude-opus-4-8)
dao-jun
approved these changes
Jun 13, 2026
lhotari
marked this pull request as draft
June 13, 2026 12:03
…ished module metadata
Every published Gradle Module Metadata (.module) recorded
org.apache.pulsar:pulsar-dependencies as an org.gradle.category=enforced-platform
dependency in its runtimeElements variant, because the platform was declared on the
`implementation` bucket (which the consumable runtimeElements variant extends). An
enforced platform in published metadata forces Pulsar's internal dependency versions
onto every downstream Gradle consumer and removes their ability to override them
(Gradle's platforms docs warn against using enforcedPlatform on a component intended
for consumption). The build was hiding the resulting GenerateModuleMetadata validation
error with suppressedValidationErrors("enforced-platform") instead of fixing it.
Declare the enforced platform on a new non-consumable, non-resolvable `internalPlatform`
bucket that only the resolvable build classpaths (compile/runtime/test classpaths and
the annotation-processor paths) extend. The platform still aligns the build's own
resolution and feeds versionMapping for POM versions, but it no longer reaches the
published apiElements/runtimeElements variants. The validation suppression is removed so
the check now guards against the leak regressing.
The async-http-client / jakarta.activation component-metadata rule re-added
jakarta.activation-api and angus-activation without versions, relying on the ambient
platform; give them explicit catalog versions so configurations that do not extend the
platform (e.g. the protobuf plugin's *ProtoPath) still resolve.
pulsar-dependencies itself remains published as a platform/BOM so other Pulsar projects
(e.g. pulsar-connectors) can depend on it to align versions; only the unconditional
forcing through every library's published metadata is removed.
Verified: publishAllPublicationsToLocalDeployRepository succeeds with the validation
un-suppressed; across all published modules there are 0 enforced-platform entries, 0
pulsar-dependencies references and 0 versionless deps, and POM versions stay concrete; a
Gradle consumer resolves pulsar-client-original with pulsar-dependencies absent from the
graph and a consumer-declared strict commons-lang3 3.12.0 overrides Pulsar's 3.20.0.
Assisted-by: Claude Code (claude-opus-4-8)
lhotari
marked this pull request as ready for review
June 13, 2026 13:05
…platform off implementation
The preceding commit moved the enforced version-alignment platform from the
`implementation` bucket to the non-published `internalPlatform` bucket. The server and
shell distributions collect their bundled jars through a custom `distLib` configuration
that extendsFrom `implementation`, so it stopped inheriting the platform and its
transitive versions drifted (e.g. netty-codec-http2 4.2.15 -> 4.2.13, grpc 1.79 -> 1.75,
snakeyaml 2.0 -> 2.6), which checkBinaryLicense correctly rejected in CI.
Have both distributions' `distLib` extend `internalPlatform` so the enforced platform
aligns the bundled versions with the version catalog again. Also clarify the
convention-plugin comment: the alignment platform is wired onto the standard resolvable
classpaths by name, and custom artifact-collecting configurations (like distLib) must
extend internalPlatform explicitly because flag-based matching is unreliable for
configurations created via `configurations.creating {}` (their canBeResolved/canBeConsumed
flags are set inside the creation block, after a flag-based configureEach has run).
Verified: checkBinaryLicense passes for both distributions (forced rerun);
publishAllPublicationsToLocalDeployRepository still succeeds with the enforced-platform
validation un-suppressed (0 enforced-platform and 0 pulsar-dependencies references across
published module metadata); assemble/rat/spotlessCheck/checkstyle pass; and the consumer
override test still resolves with pulsar-dependencies absent and a strict commons-lang3
3.12.0 winning over Pulsar's 3.20.0.
Assisted-by: Claude Code (claude-opus-4-8)
…agecrypto-bc
pulsar-client-messagecrypto-bc declared implementation(project(":bouncy-castle:bouncy-castle-bc"))
alongside its direct bcpkix (implementation) and bcprov (api) dependencies. MessageCryptoBc compiles
against bcpkix/bcprov types directly, and the bc module only re-exposes those same jars as
`implementation` plus an unused BouncyCastleLoader (legacy NAR-era code, never instantiated —
SecurityUtility loads the provider via Class.forName). The bc-module dependency was therefore
redundant; removing it changes nothing at runtime (bcprov/bcpkix remain via the direct declarations)
and the bc module is still bundled in the distributions via their direct distLib dependency.
While checking the FIPS test, fix a stale exclusion in bouncy-castle/bcfips-include-test: it excluded
the non-FIPS module as `module = "bc"`, but the module's artifactId is "bouncy-castle-bc", so the
exclusion silently stopped matching after the rename. FIPS isolation still held (the non-FIPS
bcprov/bcpkix libraries are excluded by name), but the exclusion now correctly targets the module.
Verified: bcfips-include-test (FIPS TlsProducerConsumerTest) and messagecrypto-bc tests pass; both
distributions' checkBinaryLicense pass; publishAllPublicationsToLocalDeployRepository is clean and
messagecrypto-bc's published metadata no longer references bouncy-castle-bc while still exposing
bcprov (compile) and bcpkix (runtime).
Assisted-by: Claude Code (claude-opus-4-8)
2 of 11 tasks
void-ptr974
approved these changes
Jun 13, 2026
void-ptr974
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Excellent work on a fairly tricky Gradle publishing cleanup.
This does a great job addressing several subtle metadata issues at once: publishing the v5 client artifacts, fixing ABI-relevant scopes, removing blanket POM exclusions, and keeping the internal enforced platform out of published Gradle Module Metadata. The local publish check in CI is a particularly good addition and should make this area much easier to keep correct going forward.
The shaded client artifacts (pulsar-client-shaded, pulsar-client-admin-shaded, pulsar-client-all) bundle and relocate their third-party dependencies (netty, guava, jackson, bookkeeper, ...) under org.apache.pulsar.shade.*, but their published POM/Gradle Module Metadata declared the bundled component modules (pulsar-client-original, pulsar-client-admin-original, pulsar-common, pulsar-client-messagecrypto-bc) as runtime dependencies. Consumers therefore pulled the entire UNSHADED dependency tree (85 components: all of netty, guava, jackson-core, bookkeeper, async-http-client, ...) alongside the relocated copies inside the jar -- defeating the shading and forcing Pulsar's dependency versions onto consumers. The Maven build produced a dependency-reduced POM (createDependencyReducedPom); the Gradle migration (PIP-463) lost it. Publish the com.gradleup.shadow plugin's `shadow` component for the shaded modules instead of the `java` component. The `shadow` component carries the shadow jar plus EXACTLY the dependencies declared in the `shadow` configuration, mapped to Maven runtime scope -- the Gradle-native dependency-reduced POM. Each shaded module now declares its bundled component modules as `implementation` (so shadowJar packs them) and the non-bundled runtime dependencies via the `shadow` configuration: pulsar-client-api (+admin-api), protobuf-java, jackson-annotations, bcprov/bcpkix (signed, not relocatable), opentelemetry-api(+incubator), jspecify, and -- for logging -- slf4j-api + slog ONLY (never log4j). publish-conventions branches on the shadow plugin: shaded modules publish components["shadow"] (wired after the shadow plugin's own afterEvaluate, no versionMapping); all other java-library modules keep publishing components["java"] with resolved version mapping, unchanged. public-java-library-conventions adds `shadow` to the published-scope validation. Verified: a Gradle consumer resolving pulsar-client-shaded now sees 15 runtime/compile components (was 85) with NO unshaded io.netty/guava/jackson-core/bookkeeper/ async-http-client, NO log4j, and pulsar-client-api present on both classpaths; the shade-test modules still compile; both distributions' checkBinaryLicense pass; publishAllPublicationsToLocalDeployRepository succeeds with the enforced-platform validation un-suppressed. Assisted-by: Claude Code (claude-opus-4-8)
…g the JCA provider globally
The bc/bcfips modules carried a NAR-era loader (BouncyCastleLoader, BouncyCastleFipsLoader, the
BCLoader interface, and the META-INF/services/bouncy-castle.yaml descriptors) that was a workaround
for loading the BouncyCastle provider inside Pulsar IO connector NARs. Nothing instantiates these
loaders or reads the descriptors any more (no ServiceLoader, no reflection); Pulsar IO connectors
are moving to a separate repository and can re-add such a mechanism there if ever needed. Removed
the loader classes, package-info files and yaml descriptors, and dropped the now-unused slog /
pulsar-common dependencies from the bc/bcfips build files (the modules now carry no classes; they
only bundle the BouncyCastle provider jars onto the runtime classpath).
Message crypto no longer registers the BouncyCastle provider in the global JCA provider list.
MessageCryptoBc previously called Security.addProvider(new BouncyCastleProvider()) and referenced
the provider by name ("BC") in Cipher/KeyFactory.getInstance(...). It now holds a single
BouncyCastleProvider instance and passes it directly to getInstance(...) and to
JcaPEMKeyConverter.setProvider(...), so it never mutates the JVM-wide provider list -- client
applications are free to manage their own JCA providers. AES-GCM still prefers the JDK's SunJCE
provider (registered by the JDK) and falls back to the BouncyCastle instance. The redundant global
registrations in the pulsar-functions ProducerBuilderFactory and PulsarSource -- which existed only
so message crypto could find "BC" by name -- are removed too.
bcprov/bcpkix remain required: ECIES (no JDK equivalent), RSA-OAEP key wrapping and EC key handling
are implemented against BouncyCastle. SecurityUtility's reflective, FIPS-agnostic
getProvider()/getBCProviderFromClassPath() is kept -- it loads whichever provider
(BouncyCastleProvider or the differently-named BouncyCastleFipsProvider) is on the classpath for
TLS, without pulsar-common having to compile against either.
Verified: testECDSAEncryption (ECIES), testRSAEncryption (RSA-OAEP) and
testE2EEncryptionWithCompression pass; the FIPS TlsProducerConsumerTest passes; checkstyle/spotless
pass for the changed code; publishAllPublicationsToLocalDeployRepository and both distributions'
checkBinaryLicense pass.
Assisted-by: Claude Code (claude-opus-4-8)
…age crypto Follow-up to the previous commit: defer creating the BouncyCastle provider until it is actually needed, and make AES-GCM provider selection robust on non-HotSpot JVMs. - The BouncyCastle provider is now created via the initialization-on-demand holder idiom (BcProviderHolder), so message crypto that only performs AES-GCM through a JDK provider never instantiates it, and any failure to construct it surfaces at use time rather than at class load. - AES-GCM cipher creation no longer fixes a SunJCE-vs-BouncyCastle choice at class initialization. It prefers the SunJCE provider instance when present (HotSpot), falls back to the platform default provider (e.g. IBMJCE on IBM JDKs where SunJCE is absent), and only then to BouncyCastle. The provider is resolved lazily per thread, so a missing or unusual provider cannot break class loading. Verified: testECDSAEncryption, testRSAEncryption and testE2EEncryptionWithCompression pass; checkstyle and spotless pass. Assisted-by: Claude Code (claude-opus-4-8)
… BC libraries directly ### Motivation The `bouncy-castle/bc` and `bouncy-castle/bcfips` modules were thin wrappers whose only purpose was to (a) put the BouncyCastle provider jars on the runtime classpath and (b) host the NAR loader classes. After the loader was removed, both modules carried no classes of their own — they were empty published artifacts that only added indirection plus an extra `-pkg` artifact to the distributions. ### Modifications - Delete the empty `bouncy-castle:bouncy-castle-bc` and `bouncy-castle:bcfips` modules. - Consumers (`pulsar-client`, both distributions, and the `pulsar-client-all` shade test) now depend on `bcprov-jdk18on` + `bcpkix-jdk18on` directly via the version catalog. - Drop the `-pkg` classifier rename logic from the server/shell distribution scripts and the `bouncy-castle-bc` entries from `CheckBinaryLicenseTask` and the NAR platform-module set. The BC jars are already listed in both distribution LICENSE files under their Maven artifact names, so `checkBinaryLicense` stays green. - Remove the two wrapper modules from `pulsar-bom`. - Relocate the FIPS TLS integration test from `bouncy-castle/bcfips-include-test` to `tests/pulsar-client-test-bcfips`, depending on the FIPS BC libraries (`bc-fips`, `bcpkix-fips`, `bcutil-fips`) directly. FIPS is selected by excluding the non-FIPS `*-jdk18on` jars so the two signed providers never share a classpath. ### Verifications - `publishAllPublicationsToLocalDeployRepository` clean; `pulsar-client-original` GMM/POM now reference `org.bouncycastle:bcprov-jdk18on`/`bcpkix-jdk18on` directly (no `bouncy-castle-bc`). - Both distributions' `checkBinaryLicense` report `Result: OK`. - The relocated FIPS test (`TlsProducerConsumerTest`) passes (3/3) with only the FIPS provider on the classpath. Assisted-by: Claude Code (claude-opus-4-8)
…stle-bc module The bouncy-castle-bc wrapper module was removed in the previous commit; update the pulsar-client-messagecrypto-bc dependency comment so it no longer names a module that no longer exists, leaving a self-contained rationale for the direct BC dependencies. Assisted-by: Claude Code (claude-opus-4-8)
lhotari
marked this pull request as draft
June 13, 2026 21:46
… via SecurityUtility ### Motivation `MessageCryptoBc` hardcoded the non-FIPS `BouncyCastleProvider`, so it resolved the JCA provider differently from the rest of Pulsar (TLS) and could not work on a FIPS-only classpath. Message crypto should resolve the provider the same FIPS-agnostic way. Separately, `pulsar-common` was declared `compileOnly` in `pulsar-client-messagecrypto-bc` even though `MessageCryptoBc` uses its types at runtime (`MessageMetadata`, and now `SecurityUtility`), so the published POM omitted it and a standalone consumer would hit `NoClassDefFoundError`. ### Modifications - `MessageCryptoBc` now resolves the JCA provider via `SecurityUtility.getProvider()` — the same FIPS-agnostic lookup used for TLS (non-FIPS "BC" or FIPS "BCFIPS", whichever is on the classpath) — instead of `new BouncyCastleProvider()`. Resolution stays lazy via the initialization-on-demand holder. Non-FIPS behavior is unchanged (the lookup returns a `BouncyCastleProvider`); a FIPS classpath now uses `BCFIPS` rather than failing to load the hardcoded class. - Change `pulsar-common` from `compileOnly` to `implementation` in `pulsar-client-messagecrypto-bc` so its published POM correctly declares the runtime dependency. ### Verifications - `SimpleProducerConsumerTest.testECDSAEncryption`/`testRSAEncryption` and `V5EncryptionTest` pass with the `SecurityUtility`-resolved provider. - `publishAllPublicationsToLocalDeployRepository` clean; the messagecrypto-bc POM now declares `org.apache.pulsar:pulsar-common` (runtime scope). - `spotlessCheck` passes. Assisted-by: Claude Code (claude-opus-4-8)
lhotari
marked this pull request as ready for review
June 13, 2026 23:11
merlimat
approved these changes
Jun 13, 2026
lhotari
added a commit
to lhotari/pulsar
that referenced
this pull request
Jul 19, 2026
185 master commits since the merge-base. 27 conflicts resolved: - 3 PIP-337 files master modified but PIP-478 deletes (DefaultPulsarSslFactory, PulsarSslConfiguration, PulsarHttpAsyncSslEngineFactory): deletion stands; the Netty 4.2 endpoint-identification semantics from 982eac3 are handled by the new SPI's JdkSslContext path (native-path fix follows as its own commit). - bouncy-castle bcloader modules: master's apache#26020 removal stands (branch's import fix is moot). - 23 content conflicts (TLS/admin/proxy/websocket integration surface, PIP-472 jakarta migration, Swagger v3, PIP-473, apache#26020 build conventions): both sides' intents preserved. Merge adaptations for master-side API changes to branch-only code: - AHC 3.0.10 Duration-typed timeouts/TTL in HttpClient, FrameworkHttpClientFactory - pulsar-perf v5-client migration rewired from removed api.v5.config.TlsPolicy to org.apache.pulsar.tls.TlsPolicy
lhotari
added a commit
to lhotari/pulsar
that referenced
this pull request
Jul 19, 2026
…all sites after the master merge - MessageCryptoBc (master apache#26020) resolved the BouncyCastle provider via the removed SecurityUtility.getProvider(); use its decomposed equivalent JcaProviders.getProvider() (same FIPS-agnostic lookup). - PulsarClientTool + PerfClientUtils (master's v5-client migrations) built the removed experimental api.v5.config.TlsPolicy; both translate to the PIP-478 org.apache.pulsar.tls.TlsPolicy builder unchanged. - pulsar-client-api-v5: drop the stale 'unpublished module' comment (apache#26020 made it a published public library).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Pulsar's public client/admin libraries (including the new v5 client) must publish to a Maven
repository with correct POM and Gradle Module Metadata so that both Maven and Gradle consumers
resolve them properly. The Gradle-based publishing (PIP-463) had several metadata problems:
pulsar-client-api-v5,pulsar-client-v5) were not beingpublished at all.
implementationwhere they should beapi, producing thewrong Maven scope (
runtimeinstead ofcompile) and incorrect Gradle Module Metadata variants —so Gradle consumers couldn't compile against types that are part of a module's public API.
<exclusion>entries(
log4j-slf4j-impl,bc-fips), produced by a build-wideconfigurations.all { exclude(...) }.pulsar-dependencies) leaked into publishedGradle Module Metadata as an
enforced-platformdependency on every library'sruntimeElements,forcing Pulsar's internal dependency versions onto downstream Gradle consumers and removing their
ability to override — and the resulting publication-validation error was being suppressed rather
than fixed.
pulsar-client,pulsar-client-admin,pulsar-client-all) declaredthe bundled (relocated) modules as runtime dependencies in their published metadata, so consumers
pulled the entire un-shaded tree alongside the relocated copies, defeating the purpose of shading.
This PR makes publishing produce correct metadata end to end. It supersedes #26018 (the initial
v5-publishing fix), whose commit is included here, so #26018 can be closed in favor of this PR.
Modifications
pulsar-client-api-v5andpulsar-client-v5now usepulsar.public-java-library-conventions. AMavenPublishLocksharedbuild service serializes uploads (Nexus creates an implicit staging repo on first upload and
dislikes concurrent uploads). A CI step runs
publishAllPublicationsToLocalDeployRepositorytocatch publishing regressions.
apivsimplementationscopes across 34 modules (153 ABI-drivenimplementation→apipromotions), so published POM scopes (compile/runtime) and Gradle modulemetadata variants accurately reflect each module's public API. No dependency versions change.
configurations.all { exclude(...) }for
log4j-slf4j-implandbc-fips(and themodulesUsingBcFipsallowlist); both only arrivetransitively via
bookkeeper-server, which already has a component-metadata rule that strips them.pulsar-common/pulsar-broker-commoncarried a vestigialtestImplementation(bc-fips)that re-exported FIPS BouncyCastle through theirtestJarontodownstream test classpaths already carrying non-FIPS
bcprov, causingCryptoServicesRegistrarsigner-mismatch failures. They now use the non-FIPSbcprov(theprovider used in production); FIPS stays isolated in the dedicated FIPS test module.
enforcedPlatform(:pulsar-dependencies)is now declared on a non-published
internalPlatformbucket that only the resolvable buildclasspaths extend, so it aligns the build (and feeds
versionMapping) without leaking intopublished
apiElements/runtimeElements. ThesuppressedValidationErrors("enforced-platform")workaround is removed, so the validation now actively guards against regression.
pulsar-dependenciesremains published as a platform so other Pulsar projects (e.g. pulsar-connectors) can depend on it
to align versions.
distLibconfigurations extendinternalPlatformso bundled dependency versions match the version catalog (verified by
checkBinaryLicense).pulsar-client,pulsar-client-admin, andpulsar-client-allnow publish thecom.gradleup.shadowshadowcomponent, whose declared dependencies are exactly the non-bundled runtime libraries (the API
modules, protobuf, jackson-annotations, bcprov/bcpkix, opentelemetry, jspecify, and slf4j/slog —
logging is slf4j+slog only, no log4j) instead of the bundled/relocated modules. This restores the
Maven
createDependencyReducedPombehaviour that was lost in the Gradle migration: consumers nolonger pull the un-shaded dependency tree.
bouncy-castle:bouncy-castle-bcandbouncy-castle:bcfipswere thin wrappers that only bundled the upstream BouncyCastle jars (plus aNAR-era JCA provider loader). The dead NAR loader is removed;
MessageCryptoBcno longer registersa provider globally — it holds a lazily-initialized
BouncyCastleProviderinstance (initialization-on-demand holder) and passes it explicitly to the JCA APIs, so the client never mutates the
JVM-global provider list — and the now-empty wrapper modules are deleted. Consumers (
pulsar-client,both distributions, the shade tests) depend on
org.bouncycastle:bcprov-jdk18on+bcpkix-jdk18ondirectly. The FIPS TLS integration test moves to
tests/pulsar-client-test-bcfipsand selects theFIPS provider by excluding the non-FIPS
*-jdk18onjars.Verifying this change
This change is covered by build verification (it is a build/packaging change):
publishAllPublicationsToLocalDeployRepositorysucceeds with theenforced-platformvalidationun-suppressed; across all published modules there are 0 blanket exclusions, 0
enforced-platform entries and 0
pulsar-dependenciesreferences, POM versions are concrete,and the v5 client libraries are published.
pulsar-client-originalfrom a local repo withpulsar-dependenciesabsent from the graph and can override a version the enforced platformpreviously forced (strict
commons-lang3:3.12.0wins over Pulsar's3.20.0).pulsar-clientresolves only the non-bundled runtime dependencies (≈15components) instead of the full un-shaded tree (≈85), with no relocated artifacts leaking and no
log4j.
assemble,rat,spotlessCheck,checkstyle, both distributions'checkBinaryLicense, theFIPS
TlsProducerConsumerTest, and the affected unit/integration tests pass in CI.publishing-metadata regressions.
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
api/implementationscope corrections change the scopes in publishedPOMs and the variants in Gradle Module Metadata, the shaded jars now publish dependency-reduced
POMs, and the blanket
<exclusion>entries are removed. No dependency versions change;distribution contents are verified unchanged by
checkBinaryLicense.new v5 client) are published to Maven repositories.
Warning
Breaking change for downstream consumers (Pulsar 5.0). The published artifacts
org.apache.pulsar:bouncy-castle-bcandorg.apache.pulsar:bouncy-castle-bcfips— including thepkgclassifier — are removed. They were internal convenience wrappers that only re-exposed theupstream BouncyCastle jars and carried no Pulsar classes or public API. Downstream projects that
depended on them directly should instead depend on the upstream coordinates:
org.bouncycastle:bcprov-jdk18on+org.bouncycastle:bcpkix-jdk18on(or, for FIPS,org.bouncycastle:bc-fips/bcpkix-fips/bcutil-fips) — which is exactly what the Pulsarclient now does.
Documentation
doc-not-needed(Build/packaging change with no user-facing documentation impact. The removed
org.apache.pulsar:bouncy-castle-bc/bouncy-castle-bcfipsartifacts are an internal packagingdetail; the breaking-change note above is for downstream build authors.)