migration from jreleaser to mavenPublish plugin (#277)
#152 ## Motivation and Context To simplify publishing, use the [recommended plugin](https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-publish-libraries.html#set-up-the-publishing-plugin) ## Breaking Changes no ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist - [x] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [x] My code follows the repository's style guidelines - [x] New and existing tests pass locally - [ ] I have added appropriate error handling - [ ] I have added or updated documentation as needed
This commit is contained in:
parent
edbd31d381
commit
d909835025
2 changed files with 43 additions and 149 deletions
|
|
@ -1,75 +0,0 @@
|
|||
import org.jreleaser.model.Active
|
||||
|
||||
plugins {
|
||||
id("org.jreleaser")
|
||||
id("mcp.publishing")
|
||||
}
|
||||
|
||||
jreleaser {
|
||||
gitRootSearch = true
|
||||
strict = true
|
||||
|
||||
signing {
|
||||
active = Active.ALWAYS
|
||||
armored = true
|
||||
artifacts = true
|
||||
files = true
|
||||
}
|
||||
|
||||
deploy {
|
||||
active = Active.ALWAYS
|
||||
maven {
|
||||
active = Active.ALWAYS
|
||||
mavenCentral.create("ossrh") {
|
||||
active = Active.ALWAYS
|
||||
sign = true
|
||||
url = "https://central.sonatype.com/api/v1/publisher"
|
||||
applyMavenCentralRules = false
|
||||
maxRetries = 240
|
||||
stagingRepository(layout.buildDirectory.dir("staging-deploy").get().asFile.path)
|
||||
|
||||
// workaround: https://github.com/jreleaser/jreleaser/issues/1784
|
||||
afterEvaluate {
|
||||
publishing.publications.forEach { publication ->
|
||||
if (publication is MavenPublication) {
|
||||
val pubName = publication.name
|
||||
|
||||
if (!pubName.contains("jvm", ignoreCase = true)
|
||||
&& !pubName.contains("metadata", ignoreCase = true)
|
||||
&& !pubName.contains("kotlinMultiplatform", ignoreCase = true)
|
||||
) {
|
||||
artifactOverride {
|
||||
artifactId = when {
|
||||
pubName.contains("wasm", ignoreCase = true) ->
|
||||
"${project.name}-wasm-${pubName.lowercase().substringAfter("wasm")}"
|
||||
|
||||
else -> "${project.name}-${pubName.lowercase()}"
|
||||
}
|
||||
jar = false
|
||||
verifyPom = false
|
||||
sourceJar = false
|
||||
javadocJar = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checksum {
|
||||
individual = false
|
||||
artifacts = false
|
||||
files = false
|
||||
}
|
||||
}
|
||||
|
||||
release {
|
||||
github {
|
||||
skipRelease = true
|
||||
skipTag = true
|
||||
overwrite = false
|
||||
token = "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,58 +1,51 @@
|
|||
plugins {
|
||||
`maven-publish`
|
||||
id("com.vanniktech.maven.publish")
|
||||
signing
|
||||
}
|
||||
|
||||
val javadocJar by tasks.registering(Jar::class) {
|
||||
archiveClassifier.set("javadoc")
|
||||
mavenPublishing {
|
||||
signAllPublications()
|
||||
publishToMavenCentral(automaticRelease = true)
|
||||
|
||||
pom {
|
||||
name = project.name
|
||||
description = "Kotlin implementation of the Model Context Protocol (MCP)"
|
||||
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name = "MIT License"
|
||||
url = "https://github.com/modelcontextprotocol/kotlin-sdk/blob/main/LICENSE"
|
||||
distribution = "repo"
|
||||
}
|
||||
}
|
||||
|
||||
organization {
|
||||
name = "Anthropic"
|
||||
url = "https://www.anthropic.com"
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id = "JetBrains"
|
||||
name = "JetBrains Team"
|
||||
organization = "JetBrains"
|
||||
organizationUrl = "https://www.jetbrains.com"
|
||||
}
|
||||
}
|
||||
|
||||
scm {
|
||||
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
|
||||
connection = "scm:git:git://github.com/modelcontextprotocol/kotlin-sdk.git"
|
||||
developerConnection = "scm:git:git@github.com:modelcontextprotocol/kotlin-sdk.git"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications.withType<MavenPublication>().configureEach {
|
||||
if (name.contains("jvm", ignoreCase = true)) {
|
||||
artifact(javadocJar)
|
||||
}
|
||||
|
||||
pom {
|
||||
name = project.name
|
||||
description = "Kotlin implementation of the Model Context Protocol (MCP)"
|
||||
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name = "MIT License"
|
||||
url = "https://github.com/modelcontextprotocol/kotlin-sdk/blob/main/LICENSE"
|
||||
distribution = "repo"
|
||||
}
|
||||
}
|
||||
|
||||
organization {
|
||||
name = "Anthropic"
|
||||
url = "https://www.anthropic.com"
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id = "JetBrains"
|
||||
name = "JetBrains Team"
|
||||
organization = "JetBrains"
|
||||
organizationUrl = "https://www.jetbrains.com"
|
||||
}
|
||||
}
|
||||
|
||||
scm {
|
||||
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
|
||||
connection = "scm:git:git://github.com/modelcontextprotocol/kotlin-sdk.git"
|
||||
developerConnection = "scm:git:git@github.com:modelcontextprotocol/kotlin-sdk.git"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "staging"
|
||||
url = uri(layout.buildDirectory.dir("staging-deploy"))
|
||||
}
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -68,4 +61,4 @@ signing {
|
|||
useInMemoryPgpKeys(signingKey.get(), signingPassphrase.get())
|
||||
sign(publishing.publications)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue