Skip to content

Maven

PGP signs and publishes packages to Maven Central.

Configuration

OptionDescription
mavenCliPathPath to Maven CLI (must be executable)
mavenSettingsPathPath to Maven settings.xml
mavenRepoIdMaven server ID in settings.xml
mavenRepoUrlMaven repository URL
androidAndroid configuration object or false
kmpKotlin Multiplatform configuration or false

Android Configuration

OptionDescription
distDirRegexPattern for distribution directory names
fileReplaceeRegexPattern for module name substring to replace
fileReplacerStrReplacement string for Android distribution file

KMP Configuration

OptionDescription
rootDistDirRegexPattern for root distribution directory
appleDistDirRegexPattern for Apple platform directories
klibDistDirRegexPattern for JS/WASM directories

Environment Variables

NameDescription
OSSRH_USERNAMESonatype repository username
OSSRH_PASSWORDSonatype repository password
GPG_PASSPHRASEPassphrase for GPG private key
GPG_PRIVATE_KEYGPG private key (optional, uses default if not set)

Examples

Without Android

targets:
- name: maven
mavenCliPath: scripts/mvnw.cmd
mavenSettingsPath: scripts/settings.xml
mavenRepoId: ossrh
mavenRepoUrl: https://oss.sonatype.org/service/local/staging/deploy/maven2/
android: false

With Android

targets:
- name: maven
mavenCliPath: scripts/mvnw.cmd
mavenSettingsPath: scripts/settings.xml
mavenRepoId: ossrh
mavenRepoUrl: https://oss.sonatype.org/service/local/staging/deploy/maven2/
android:
distDirRegex: /^sentry-android-.*$/
fileReplaceeRegex: /\d\.\d\.\d(-SNAPSHOT)?/
fileReplacerStr: release.aar