Skip to content

Commit

Permalink
Publish to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpoole committed Apr 7, 2021
1 parent c8c15f4 commit 7b8f052
Showing 1 changed file with 53 additions and 6 deletions.
59 changes: 53 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
plugins {
id 'java'
id 'maven-publish'
id 'signing'
}

repositories {
Expand All @@ -22,22 +23,68 @@ dependencies {

group = 'ch.poole.geo'
version = '1.2.0'
description = 'MB Tiles for Java'
sourceCompatibility = '1.7'

java {
withSourcesJar()
withJavadocJar()
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

ext {
repoUrl = 'https://github.com/simonpoole/mbtiles4j.git'
spdxId = 'Apache-2.0'
}

publishing {
publications {
maven(MavenPublication) {
from(components.java)
Release(MavenPublication) {
from components.java
groupId group
artifactId 'mbtiles4j'
pom {
name = artifactId
description = 'A pure-java reader/writer for MBTiles'
url = 'https://github.com/simonpoole/mbtiles4j'
scm {
url = repoUrl
}
licenses {
license {
name = spdxId
url = 'https://raw.githubusercontent.com/simonpoole/mbtiles4j/master/LICENSE'
}
}
developers {
developer {
id = 'ckcook'
name = 'Cam Cook'
url ='http://www.github.com/ccook'
}
developer {
name = 'Simon Poole'
}
}
}
repositories {
maven {
name = 'sonatype'
credentials {
username System.getenv('SONATYPE_USER')
password System.getenv('SONATYPE_PASSWORD')
}
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
}
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
signing {
sign publishing.publications.Release
}

0 comments on commit 7b8f052

Please sign in to comment.