Skip to content

Commit

Permalink
Set up artifact signing and publishing from gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
gnagy committed Nov 25, 2023
1 parent 3fd9c68 commit dfb0efd
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
kotlin("jvm") version "1.9.10"
`maven-publish`
signing
id("org.jlleitschuh.gradle.ktlint") version "11.6.1"
id("com.github.ben-manes.versions") version "0.50.0"
}
Expand All @@ -25,3 +27,55 @@ dependencies {
tasks.withType<Test> {
useJUnitPlatform()
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
packaging = "jar"
name.set("perspektive")
description.set(project.description)
url.set("https://github.com/gnagy/perspektive")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("gnagy")
name.set("Gergely Nagy")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/gnagy/perspektive.git")
developerConnection.set("scm:git:ssh://github.com/gnagy/perspektive.git")
url.set("https://github.com/gnagy/perspektive")
}
}
}
}

repositories {
maven {
name = "OSSRH"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.findProperty("ossrhUsername") as String?
password = project.findProperty("ossrhPassword") as String?
}
}
}
}

signing {
sign(publishing.publications["maven"])
}

0 comments on commit dfb0efd

Please sign in to comment.