Skip to content

Publishing artifacts

This project publishes all non-sample modules to Maven Central and the Gradle plugin to the Gradle Plugin Portal.

Prerequisites

  • Java 21
  • Sonatype OSSRH account (s01.oss.sonatype.org) with a staging profile
  • GPG signing key (ASCII-armored) for Maven Central
  • Gradle Plugin Portal key/secret

Provide credentials via ~/.gradle/gradle.properties or environment variables:

ossrhUsername=...
ossrhPassword=...
signingKey=...          # ASCII-armored private key
signingPassword=...

# or
OSSRH_USERNAME=...
OSSRH_PASSWORD=...
SIGNING_KEY=...
SIGNING_PASSWORD=...

# Gradle Plugin Portal
gradle.publish.key=...
gradle.publish.secret=...

Prepare a release

  1. Update version in gradle/libs.versions.toml (openapi-testgen).
  2. Update docs/changelog/CHANGELOG.md.
  3. Run ./gradlew check.

Publish to Maven Central

Publish each module (exclude samples/):

for module in model example-value core generator-template pattern-value pattern-support distribution-bundle cli plugin; do
  ./gradlew -p "$module" publish
done

For local verification:

./gradlew -p core publishToMavenLocal

After upload, close and release the staging repository in Sonatype OSSRH.

Publish to Gradle Plugin Portal

./gradlew -p plugin publishPlugins

The plugin portal release is separate from Maven Central; run both for a full release.