Skip to content

Commit

Permalink
publish to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
SMILEY4 committed Jun 18, 2023
1 parent 555c7d8 commit d843463
Showing 1 changed file with 43 additions and 22 deletions.
65 changes: 43 additions & 22 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
kotlin("jvm") version "1.7.21"
kotlin("plugin.serialization") version "1.8.21"
id("org.owasp.dependencycheck") version "8.2.1"
`maven-publish`
id("com.vanniktech.maven.publish") version "0.25.2"
}

group = "io.github.smiley4"
version = "2.2.0"

object Meta {
const val desc = "Ktor plugin to document routes and provide Swagger UI"
const val license = "Apache-2.0"
const val githubRepo = "https://github.com/SMILEY4/ktor-swagger-ui"
const val release = "todo"
const val snapshot = "todo"
const val groupId = "io.github.smiley4"
const val artifactId = "ktor-swagger-ui"
const val version = "2.2.0-SNAPSHOT"
const val name = "Ktor Swagger-UI"
const val description = "Ktor plugin to document routes and provide Swagger UI"
const val licenseName = "The Apache License, Version 2.0"
const val licenseUrl = "https://www.apache.org/licenses/LICENSE-2.0.txt"
const val scmUrl = "https://github.com/SMILEY4/ktor-swagger-ui"
const val scmConnection = "scm:git:git://github.com/SMILEY4/ktor-swagger-ui.git"
const val developerName = "smiley4"
const val developerUrl = "https://github.com/SMILEY4"
}

group = Meta.groupId
version = Meta.version


repositories {
mavenCentral()
maven(url = "https://raw.githubusercontent.com/glureau/json-schema-serialization/mvn-repo")
}

dependencies {
Expand Down Expand Up @@ -70,20 +77,34 @@ dependencies {
testImplementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
}

java {
withJavadocJar()
withSourcesJar()
kotlin {
jvmToolchain(8)
}

publishing {
publications {
create<MavenPublication>("maven") {
artifactId = "ktor-swagger-ui"
from(components["java"])
pom {
name.set("Ktor Swagger-UI")
description.set("Ktor plugin to document routes and provide Swagger UI")
url.set("https://github.com/SMILEY4/ktor-swagger-ui")
mavenPublishing {
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()
coordinates(Meta.groupId, Meta.artifactId, Meta.version)
pom {
name.set(Meta.name)
description.set(Meta.description)
url.set(Meta.scmUrl)
licenses {
license {
name.set(Meta.licenseName)
url.set(Meta.licenseUrl)
distribution.set(Meta.licenseUrl)
}
}
scm {
url.set(Meta.scmUrl)
connection.set(Meta.scmConnection)
}
developers {
developer {
id.set(Meta.developerName)
name.set(Meta.developerName)
url.set(Meta.developerUrl)
}
}
}
Expand Down

0 comments on commit d843463

Please sign in to comment.