Remove noShadowPublish
MODIFY
buildSrc/src/main/kotlin/otel.publish-conventions.gradle.kts
buildSrc/src/main/kotlin/otel.publish-conventions.gradle.kts
-import com.github.jengelman.gradle.plugins.shadow.ShadowExtension
-
plugins {
`maven-publish`
signing
@@ -8,19 +6,12 @@ plugins {
publishing {
publications {
register<MavenPublication>("maven") {
- if (tasks.names.contains("shadowJar") && findProperty("noShadowPublish") != true) {
- the<ShadowExtension>().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"])
}
- }
versionMapping {
allVariants {

MODIFY
instrumentation-api-caching/build.gradle
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)
+ }
+ }
+}

MODIFY
javaagent/build.gradle
javaagent/build.gradle
@@ -53,6 +53,7 @@ CopySpec isolateSpec(Collection<Project> 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) {

MODIFY
testing/agent-for-testing/build.gradle
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)
+ }
+ }
+}

Remove noShadowPublish (#3426)