This gradle plugin is used for mavenCentral and jcentral library publishing. It is created with help from Jernej Virag and nuuneoi blogs.
This plugin is tested with Gradle/Gradle Wrapper > 2.10 and Gradle Build Tools 2.1.0
Code below is example of usage, you only need to change extra properties inside exc {...} and set credentials inside gradle.properties or local.properties files:
gradle.properties or local.properties file inside your root folder
# MAVEN
signing.keyId=xxxxxxxx //gpg key
signing.password=xxxxxxxx //gpg pass
signing.secretKeyRingFile=/Users/<your_user>/.gnupg/secring.gpg
ossrhUsername=xxxxxx //sonatype user
ossrhPassword=xxxxxx //sonatype password
stagingRepositoryUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2/
snapshotRepositoryUrl=https://oss.sonatype.org/content/repositories/snapshots/
# JCENTRAL
bintray.user=xxxxxx //bintray user
bintray.apikey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx //bintray api key
build.gradle inside library module
group = "com.github.kkontus.stringhelper" // Maven Group ID for the artifact
archivesBaseName = "stringhelper"
//version = "1.0.6-SNAPSHOT"
version = "1.0.6"
ext {
//project info
projectName = "String Helper"
packagingType = "aar"
publishedGroupId = group
publishedArtifactId = "some artifact id"
projectDescription = "String Helper Library"
siteUrl = 'https://github.com/kkontus/StringHelper' // Homepage URL of the library
libraryName = "stringhelper"
repoName = "stringhelper"
//scm info
scmConnection = "scm:git:http://github.com/kkontus/StringHelper.git"
scmDeveloperConnection = "scm:git:https://github.com/kkontus/StringHelper.git"
scmUrl = "https://github.com/kkontus/StringHelper"
//license info
licenseName = "The Apache License, Version 2.0"
licenseUrl = "http://www.apache.org/licenses/LICENSE-2.0.txt"
//developer info
devId = "kkontus"
devName = "Kristijan Kontus"
devEmail = "[email protected]"
}
//apply from: 'central.gradle'
apply from: 'https://raw.githubusercontent.com/kkontus/mavencentral/master/central.gradle'
With this last line you can use apply from: 'url' if you want to use central.gradle file published here, or you can download it as raw file and put it inside your library module folder and use it like apply from: 'central.gradle'