lhotari opened a new pull request, #25457: URL: https://github.com/apache/pulsar/pull/25457
### Motivation The Pulsar build was migrated from Maven to Gradle, but Maven publishing (deploying artifacts to Maven repositories) was not yet implemented. This PR adds the publishing infrastructure so artifacts land at the same Maven coordinates as before (`org.apache.pulsar:*`), with proper POM metadata, GPG signing, sources/javadoc JARs, and Gradle module metadata — matching what the Apache parent POM provided automatically in the Maven build. ### Modifications **New convention plugin** `pulsar.publish-conventions.gradle.kts` in `build-logic/` that configures: - **`maven-publish` and `signing` plugins** for all publishable modules - **java-library modules**: publishes JAR + sources JAR + javadoc JAR + POM + Gradle module metadata (`.module`), with version mapping that inlines resolved dependency versions into the POM - **java-platform modules** (`pulsar-bom`, `pulsar-dependencies`): publishes POM + Gradle module metadata only (no JAR), with `<packaging>pom</packaging>` and `<dependencyManagement>` entries - **Shadow/shaded modules** (`pulsar-client-shaded`, `pulsar-client-admin-shaded`, `pulsar-client-all`, etc.): publishes the shadow JAR as the primary artifact (works correctly because `pulsar.shadow-conventions` already reconfigures `runtimeElements`/`apiElements`) - **NAR modules** (`pulsar-io-data-generator`, `pulsar-io-batch-data-generator`, tiered-storage modules): publishes `.nar` as primary artifact with `<packaging>nar</packaging>` - **ASF-compliant POM metadata**: Apache License 2.0, SCM (github.com/apache/pulsar), GitHub Issues, [email protected] mailing list, Apache Software Foundation organization - **POM cleanup**: removes `<scope>compile</scope>` (Maven default) and `<dependencyManagement>` from non-platform POMs (resolved versions are inlined by version mapping) - **GPG signing**: configurable via Gradle properties (`useGpgCmd`, `signing.gnupg.keyName`, `signing.gnupg.homeDir`), disabled by default for local development - **Local deploy repository**: `build/local-deploy-repo` via `publishAllPublicationsToLocalDeployRepository` task for testing - **Configuration cache compatible**: avoids capturing `Project` references in serialized closures **Applied to 58 modules** individually via `id("pulsar.publish-conventions")` in each module's `build.gradle.kts`. **Other changes**: - `gradle.properties`: added `systemProp.org.gradle.internal.publish.checksums.insecure=true` for ASF Nexus (repository.apache.org) compatibility - `gradle/setup-test-gpg.sh`: helper script to create a temporary GPG keyring for testing signing without touching `~/.gnupg` ### Verifying this change This change is verified as follows: - Ran `./gradlew publishAllPublicationsToLocalDeployRepository` — all 58 modules published successfully to `build/local-deploy-repo/org/apache/pulsar/` - Verified POM content for `pulsar-client-api` contains correct ASF metadata (license, SCM, etc.) and resolved dependency versions - Verified `pulsar-bom` produces only `.pom` + `.module` files with `<packaging>pom</packaging>` and `<dependencyManagement>` entries - Verified `pulsar-client-shaded` publishes 24MB shadow JAR as primary artifact - Verified NAR modules (`pulsar-io-data-generator`) publish `.nar` with `<packaging>nar</packaging>` - Verified GPG signing produces `.asc` files for all artifacts when configured with a test key - Verified Gradle module metadata (`.module` files) published alongside all POMs - Verified configuration cache compatibility (no serialization errors) ### Does this pull request potentially affect one of the following parts: - [ ] Dependencies (add or upgrade a dependency) - [ ] The public API - [ ] The schema - [ ] The default values of configurations - [ ] The threading model - [ ] The binary protocol - [ ] The REST endpoints - [ ] The admin CLI options - [ ] The metrics - [x] Anything that affects deployment ### Documentation - [x] `doc-not-needed` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
