Skip to content

Commit

Permalink
Add MavenCentral publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Thijsiez committed Oct 22, 2024
1 parent 012528a commit dad7cf1
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 6 deletions.
44 changes: 42 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@
* limitations under the License.
*/

import com.vanniktech.maven.publish.SonatypeHost

plugins {
kotlin("jvm")
id("org.jetbrains.kotlinx.kover")
id("com.vanniktech.maven.publish")
}

group = "ch.icken"
version = "0.1.0-SNAPSHOT"
val groupId: String by project
setGroup(groupId)
val artifactId: String by project
val version: String by project
setVersion(version)

repositories {
mavenCentral()
Expand Down Expand Up @@ -52,6 +58,40 @@ java {
kotlin {
jvmToolchain(17)
}
mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, false)

signAllPublications()

coordinates(groupId, artifactId, version)

pom {
name = artifactId
description = "A dynamic, type-safe way to write your queries"
url = "https://icken.ch/panache-kotlin-dsl"

licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}

developers {
developer {
id = "Thijsiez"
name = "Thijs Koppen"
email = "[email protected]"
}
}

scm {
url = "https://github.com/Thijsiez/panache-kotlin-dsl"
connection = "scm:git:https://github.com/Thijsiez/panache-kotlin-dsl"
developerConnection = "scm:git:https://github.com/Thijsiez/panache-kotlin-dsl"
}
}
}

tasks {
test {
Expand Down
3 changes: 0 additions & 3 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ plugins {
id("org.sonarqube")
}

group = "ch.icken"
version = "0.1.0-SNAPSHOT"

repositories {
mavenCentral()
}
Expand Down
6 changes: 6 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
# limitations under the License.
#

groupId=ch.icken
artifactId=panache-kotlin-dsl
version=0.0.1

#https://github.com/quarkusio/quarkus Pinned, do not change
# Minimum, because of https://osv.dev/vulnerability/GHSA-f8h5-v2vg-46rr
# Does not need to be upgraded since we only use the Panache API
Expand Down Expand Up @@ -42,5 +46,7 @@ compileTestingVersion=1.5.0

#https://github.com/Kotlin/kotlinx-kover
koverVersion=0.8.3
#https://github.com/vanniktech/gradle-maven-publish-plugin
mavenPublishVersion=0.30.0

kotlin.code.style=official
5 changes: 4 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ pluginManagement {
plugins {
val kotlinVersion: String by settings
val koverVersion: String by settings
val mavenPublishVersion: String by settings

kotlin("jvm") version kotlinVersion
id("org.jetbrains.kotlinx.kover") version koverVersion
id("com.vanniktech.maven.publish") version mavenPublishVersion
}
}

rootProject.name = "panache-kotlin-dsl"
val artifactId: String by settings
rootProject.name = artifactId

0 comments on commit dad7cf1

Please sign in to comment.