Skip to content

Module nexus

A custom plugin for publishing to MavenCentral which uses publish-plugin under the hood.

Download from MavenCentral

// buildSrc/build.gradle.kts

dependencies {
    implementation("com.javiersc.gradle-plugins:nexus:$version")
}

Apply

In the root build.gradle.kts

plugins {
    `javiersc-nexus`
}

Usage

Just apply it and add the next Gradle properties:

  • oss.user: Copy/generate it from the Nexus profile
  • oss.token: Copy/generate it from the Nexus profile
  • oss.stagingProfileId: Visit staging profiles select your profile from the list and copy the code after the ;, for example, the code from this url https://oss.sonatype.org/#stagingProfiles;32gf35h34654 is 32gf35h34654

Environment variables can be used instead of Gradle properties:

  • OSS_USER
  • OSS_TOKEN
  • OSS_STAGING_PROFILE_ID