Gradle plugins for publishing to Maven Central
There are 2 plugins that make up this project.
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
'todo@noreply.github.com' {
moniker("To Do")
roles("owner")
github("https://github.com/todo")
}
}
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)
waena {
license.set(WaenaExtension.License.Apache2)
// By default, publishMode is set to OSS. You can set it to S01 or Central
// if your maven central is setup for something other than oss.sonatype.org
publishMode.set(WaenaExtension.PublishMode.Central)
}
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=???
./gradlew snapshot
git tag v1.2.3 # Any semver compatible version prefixed by `v`
./gradlew -Prelease.useLastTag=true build final --stacktrace
Under the hood, this uses several other plugins and ties them all together such that you can release to maven central easily