Fix release failure
* Revert "Disable jar task in javaagent module (#4765)"
This reverts commit
* Add comment
MODIFY
conventions/src/main/kotlin/otel.publish-conventions.gradle.kts
conventions/src/main/kotlin/otel.publish-conventions.gradle.kts
@@ -9,11 +9,9 @@ publishing {
plugins.withId("java-platform") {
from(components["javaPlatform"])
}
- if (project.path != ":javaagent") {
plugins.withId("java-library") {
from(components["java"])
}
- }
versionMapping {
allVariants {

MODIFY
javaagent/build.gradle.kts
javaagent/build.gradle.kts
@@ -160,7 +160,12 @@ tasks {
val shadowJar by existing(ShadowJar::class) {
configurations = listOf(bootstrapLibs)
- dependsOn(relocateJavaagentLibs, relocateExporterLibs)
+ // without an explicit dependency on jar here, :javaagent:test fails on CI because :javaagent:jar
+ // runs after :javaagent:shadowJar and loses (at least) the manifest entries
+ //
+ // (also, note that we cannot disable the jar task completely, because it is necessary to produce
+ // javadoc and sources artifacts which maven central requires)
+ dependsOn(jar, relocateJavaagentLibs, relocateExporterLibs)
isolateClasses(relocateJavaagentLibs.get().outputs.files)
isolateClasses(relocateExporterLibs.get().outputs.files)
@@ -220,10 +225,6 @@ tasks {
add("baseJar", baseJavaagentJar)
}
- jar {
- enabled = false
- }
-
assemble {
dependsOn(shadowJar, slimShadowJar, baseJavaagentJar)
}
@@ -252,7 +253,6 @@ tasks {
publications {
named<MavenPublication>("maven") {
artifact(slimShadowJar)
- project.shadow.component(this)
}
}
}

Fix release failure (#5129)

* Revert "Disable jar task in javaagent module (#4765)"

This reverts commit 63c8b55d68591c6398d9c3f7b97cafe119281574.

* Add comment