Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 1.66 KB

File metadata and controls

30 lines (19 loc) · 1.66 KB

ADR-0007: Maven Central Publishing via Sonatype Central Portal

Status

Accepted

Context

Java library consumers expect artifacts to be available on Maven Central — the de facto standard repository. Pre-release snapshot consumers need a stable snapshot repository. The SDK also needed GPG signing for Central compliance and source + Javadoc JAR attachment for IDE integration.

Decision

Use central-publishing-maven-plugin (org.sonatype.central, v0.8.0) targeting the Sonatype Central Portal (publishingServerId: central). The release pipeline:

  1. maven-release-plugin manages version bumps, tagging, and release commits.
  2. maven-source-plugin attaches sources JAR (-sources.jar).
  3. maven-javadoc-plugin attaches Javadoc JAR (-javadoc.jar).
  4. maven-gpg-plugin signs all artifacts in the verify phase.
  5. central-publishing-maven-plugin publishes the signed bundle to Maven Central.

Pre-release snapshots go to https://oss.sonatype.org/content/repositories/snapshots/. jitpack.io is also supported as an alternative snapshot source.

Consequences

  • Enables: Standard Maven/Gradle dependency coordinates (com.contentful.java:cma-sdk:X.Y.Z); IDE source navigation via sources JAR; Javadoc in IDE tooltips.
  • Requires: GPG key available in the CI/release environment; Sonatype Central credentials configured as Maven server settings.
  • Release branch pattern: Releases use release/X.Y.Z branches with [maven-release-plugin] commits visible in git history.
  • Jitpack fallback: jitpack.yml at the repo root enables snapshot builds from any branch via jitpack.io.