Skip to content

Commit 968418a

Browse files
committed
chore: fix maven publication
1 parent 7f699bd commit 968418a

File tree

3 files changed

+9
-24
lines changed

3 files changed

+9
-24
lines changed

plugins/project/src/main/kotlin/dev.suresh.plugin.kotlin.jvm.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ tasks {
137137
registering(ReallyExecJar::class) {
138138
jarFile = shadowJar.flatMap { it.archiveFile }
139139
// javaOpts = application.applicationDefaultJvmArgs
140-
javaOpts = named<JavaExec>("run").get().jvmArgs
140+
javaOpts = jvmRunArgs
141141
execJarFile = layout.buildDirectory.dir("libs").map { it.file("${project.name}-app") }
142142
onlyIf { OperatingSystem.current().isUnix }
143143
}

plugins/project/src/main/kotlin/dev.suresh.plugin.publishing.gradle.kts

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,18 @@ publishing {
2828
publications {
2929
// Kotlin Multiplatform
3030
pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") {
31-
// withType<MavenPublication>().configureEach { artifact(taskName..) }
31+
// val customFiles = configurations.findByName("customFiles")?.artifacts.orEmpty()
32+
// withType<MavenPublication>().configureEach { customFiles.forEach { artifact(it) } }
3233
}
3334

34-
// Kotlin JVM ("org.jetbrains.kotlin.jvm")
35-
pluginManager.withPlugin("java") {
36-
register<MavenPublication>("maven") { from(components["java"]) }
35+
// Kotlin JVM - components["java"]
36+
pluginManager.withPlugin("java") {}
3737

38-
withType<MavenPublication>().configureEach {
39-
// configurations.findByName("customFile")?.artifacts?.forEach { artifact(it) }
38+
// Java Platform (BOM) - components["javaPlatform"]
39+
pluginManager.withPlugin("java-platform") {}
4040

41-
// Add an executable artifact if exists
42-
// val execJar = tasks.findByName("buildExecutable") as? ReallyExecJar
43-
// if (execJar != null) { artifact(execJar.execJarFile) }
44-
}
45-
}
46-
47-
// Java Platform (BOM)
48-
pluginManager.withPlugin("java-platform") {
49-
register<MavenPublication>("maven") { from(components["javaPlatform"]) }
50-
}
51-
52-
// Gradle version catalog
53-
pluginManager.withPlugin("version-catalog") {
54-
register<MavenPublication>("maven") { from(components["versionCatalog"]) }
55-
}
41+
// Gradle version catalog - components["versionCatalog"]
42+
pluginManager.withPlugin("version-catalog") {}
5643

5744
// Configures GHCR credentials for Jib
5845
pluginManager.withPlugin("com.google.cloud.tools.jib") {

sandbox/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ plugins {
88
id("dev.suresh.plugin.root") version "+"
99
id("dev.suresh.plugin.kotlin.mpp") version "+"
1010
alias(libs.plugins.shadow)
11-
id("dev.suresh.plugin.kotlin.docs") version "+"
12-
id("dev.suresh.plugin.publishing") version "+"
1311
}
1412

1513
description = "Sandbox App"

0 commit comments

Comments
 (0)