diff --git a/buildSrc/src/main/kotlin/otel.publish-conventions.gradle.kts b/buildSrc/src/main/kotlin/otel.publish-conventions.gradle.kts index 6a707396cc..9f4a4e0100 100644 --- a/buildSrc/src/main/kotlin/otel.publish-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/otel.publish-conventions.gradle.kts @@ -1,5 +1,3 @@ -import com.github.jengelman.gradle.plugins.shadow.ShadowExtension - plugins { `maven-publish` signing @@ -8,18 +6,11 @@ plugins { publishing { publications { register("maven") { - if (tasks.names.contains("shadowJar") && findProperty("noShadowPublish") != true) { - the().component(this) - // These two are here just to satisfy Maven Central - artifact(tasks["sourcesJar"]) - artifact(tasks["javadocJar"]) - } else { - plugins.withId("java-platform") { - from(components["javaPlatform"]) - } - plugins.withId("java-library") { - from(components["java"]) - } + plugins.withId("java-platform") { + from(components["javaPlatform"]) + } + plugins.withId("java-library") { + from(components["java"]) } versionMapping { diff --git a/instrumentation-api-caching/build.gradle b/instrumentation-api-caching/build.gradle index adb8cc1a2b..511efbd3db 100644 --- a/instrumentation-api-caching/build.gradle +++ b/instrumentation-api-caching/build.gradle @@ -41,3 +41,12 @@ jar { dependsOn shadowJar } + +// Because shadow does not use default configurations +publishing { + publications { + maven { + project.shadow.component(it) + } + } +} diff --git a/javaagent/build.gradle b/javaagent/build.gradle index 2c4315d31b..dae674002c 100644 --- a/javaagent/build.gradle +++ b/javaagent/build.gradle @@ -53,6 +53,7 @@ CopySpec isolateSpec(Collection projectsWithShadowJar) { //Includes everything needed for OOTB experience shadowJar { + archiveClassifier.set("all") def projectsWithShadowJar = [project(':instrumentation'), project(":javaagent-exporters")] projectsWithShadowJar.each { dependsOn("${it.path}:shadowJar") @@ -62,11 +63,15 @@ shadowJar { //Includes instrumentations, but not exporters task lightShadow(type: ShadowJar) { + archiveClassifier.set("") dependsOn ':instrumentation:shadowJar' def projectsWithShadowJar = [project(':instrumentation')] with isolateSpec(projectsWithShadowJar) } +// lightShadow is the default classifier we publish so disable the default jar. +jar.enabled = false + publishing { publications { maven(MavenPublication) { diff --git a/testing/agent-for-testing/build.gradle b/testing/agent-for-testing/build.gradle index 52e760ccea..b423239b0e 100644 --- a/testing/agent-for-testing/build.gradle +++ b/testing/agent-for-testing/build.gradle @@ -76,3 +76,12 @@ afterEvaluate { dependsOn shadowJar } } + +// Because shadow does not use default configurations +publishing { + publications { + maven { + project.shadow.component(it) + } + } +}