Skip to content
/ waena Public

Gradle plugins for publishing to Maven Central

Notifications You must be signed in to change notification settings

rahulsom/waena

Repository files navigation

Waena

GitHub commits since latest release

Gradle plugins for publishing to Maven Central

Setup

There are 2 plugins that make up this project.

Waena Root

Gradle Plugin Portal

This needs to be applied only to the root project.

plugins {
  id("com.github.rahulsom.waena.root").version("<VERSION>")
}

allprojects {
  group = "TODO"
}

contacts {
    validateEmails = true
    with(addPerson("todo@noreply.github.com")) {
        moniker("To Do")
        roles("owner")
        github("https://github.com/todo")
    }
}

Waena Published

Gradle Plugin Portal

This needs to be applied to each module in the project that needs to be published.

plugins {
  id("com.github.rahulsom.waena.published").version("<VERSION>")
}

description = "TODO"

// Optional (to customize license/publishMode)
// Right now there's only one working publish mode - Central
waena {
    license.set(WaenaExtension.License.Apache2)
    publishMode.set(WaenaExtension.PublishMode.Central)
}

Usage

Environment Variables

Set these 4 environment variables

export ORG_GRADLE_PROJECT_sonatypeUsername=???
export ORG_GRADLE_PROJECT_sonatypePassword=???
export ORG_GRADLE_PROJECT_signingKey=???
export ORG_GRADLE_PROJECT_signingPassword=???

Remote Publishing Setup

Waena does not configure remote Sonatype/JReleaser publishing in included/composite builds by default. For standalone builds, it configures remote publishing only when a publishing-related task is requested (snapshot, candidate, final, tasks containing publish, release, sonatype, or jreleaser). This keeps regular build/test runs and composite builds from eagerly creating remote publishing repositories.

You can override this behavior with a project property:

# Force-enable remote publishing setup
./gradlew -PwaenaConfigureRemotePublishing=true test

# Force-disable remote publishing setup
./gradlew -PwaenaConfigureRemotePublishing=false final

Publishing snapshots

./gradlew snapshot

Publishing releases

git tag v1.2.3 # Any semver compatible version prefixed by `v`
./gradlew -Prelease.useLastTag=true build final --stacktrace

Implementation Details

Under the hood, this uses several other plugins and ties them all together such that you can release to maven central easily

About

Gradle plugins for publishing to Maven Central

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages