|
| 1 | +plugins { |
| 2 | + id("samt-core.kotlin-jvm") |
| 3 | + `java-library` |
| 4 | + `maven-publish` |
| 5 | + signing |
| 6 | +} |
| 7 | + |
| 8 | +val mavenName: String by project.extra |
| 9 | +val mavenDescription: String by project.extra |
| 10 | + |
| 11 | +publishing { |
| 12 | + publications { |
| 13 | + create<MavenPublication>("maven") { |
| 14 | + pom { |
| 15 | + name.set(provider { mavenName }) |
| 16 | + description.set(provider { mavenDescription }) |
| 17 | + url.set("https://github.com/samtkit/core") |
| 18 | + licenses { |
| 19 | + license { |
| 20 | + name.set("MIT License") |
| 21 | + url.set("https://github.com/samtkit/core/blob/main/LICENSE") |
| 22 | + } |
| 23 | + } |
| 24 | + developers { |
| 25 | + developer { |
| 26 | + name.set("Pascal Honegger") |
| 27 | + email.set("pascal.honegger@samt.tools") |
| 28 | + organization.set("Simple API Modeling Toolkit") |
| 29 | + organizationUrl.set("https://github.com/samtkit") |
| 30 | + } |
| 31 | + developer { |
| 32 | + name.set("Marcel Joss") |
| 33 | + email.set("marcel.joss@samt.tools") |
| 34 | + organization.set("Simple API Modeling Toolkit") |
| 35 | + organizationUrl.set("https://github.com/samtkit") |
| 36 | + } |
| 37 | + developer { |
| 38 | + name.set("Leonard Schütz") |
| 39 | + email.set("leonard.schuetz@samt.tools") |
| 40 | + organization.set("Simple API Modeling Toolkit") |
| 41 | + organizationUrl.set("https://github.com/samtkit") |
| 42 | + } |
| 43 | + } |
| 44 | + scm { |
| 45 | + connection.set("scm:git:git://github.com/samtkit/core.git") |
| 46 | + developerConnection.set("scm:git:ssh://github.com/samtkit/core.git") |
| 47 | + url.set("https://github.com/samtkit/core") |
| 48 | + } |
| 49 | + } |
| 50 | + from(components["java"]) |
| 51 | + } |
| 52 | + } |
| 53 | + |
| 54 | + repositories { |
| 55 | + maven { |
| 56 | + name = "OSSRH" |
| 57 | + url = if (version.toString().endsWith("-SNAPSHOT")) { |
| 58 | + uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") |
| 59 | + } else { |
| 60 | + uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") |
| 61 | + } |
| 62 | + credentials { |
| 63 | + username = System.getenv("SONATYPE_USERNAME") |
| 64 | + password = System.getenv("SONATYPE_PASSWORD") |
| 65 | + } |
| 66 | + } |
| 67 | + } |
| 68 | +} |
| 69 | + |
| 70 | +signing { |
| 71 | + isRequired = !version.toString().endsWith("-SNAPSHOT") |
| 72 | + val signingKey: String? by project |
| 73 | + val signingPassword: String? by project |
| 74 | + useInMemoryPgpKeys(signingKey, signingPassword) |
| 75 | + sign(publishing.publications["maven"]) |
| 76 | +} |
0 commit comments