Publish a BOM
ADD
bom-alpha/bom-alpha.gradle
+plugins {
+ id("java-platform")
+}
+
+apply from: "$rootDir/gradle/publish.gradle"
+
+description = "OpenTelemetry Instrumentation Bill of Materials (Alpha)"
+group = "io.opentelemetry.instrumentation"
+archivesBaseName = "opentelemetry-instrumentation-bom-alpha"
+
+rootProject.subprojects.forEach { subproject ->
+ if (!project.name.startsWith("bom")) {
+ evaluationDependsOn(subproject.path)
+ }
+}
+
+javaPlatform {
+ allowDependencies()
+}
+
+dependencies {
+ api(platform("io.opentelemetry:opentelemetry-bom:${versions.opentelemetry}"))
+ api(platform("io.opentelemetry:opentelemetry-bom-alpha:${versions.opentelemetryAlpha}"))
+}
+
+afterEvaluate {
+ dependencies {
+ constraints {
+ rootProject.subprojects.sort { "$it.archivesBaseName" }
+ .collect { it }
+ .findAll { it.name != project.name && it.name != 'javaagent'}
+ .forEach { project ->
+ project.plugins.withId("maven-publish") {
+ api(project)
+ }
+ }
+ }
+ }
+}
\ No newline at end of file

MODIFY
gradle/publish.gradle
gradle/publish.gradle
@@ -23,8 +23,13 @@ publishing {
artifact sourcesJar
artifact javadocJar
} else {
+ project.plugins.withId("java-platform") {
+ from(components["javaPlatform"])
+ }
+ project.plugins.withId("java-library") {
from components.java
}
+ }
def stable = findProperty("otel.stable") ?: false
if (!stable) {
@@ -47,7 +52,6 @@ publishing {
pom {
name = 'OpenTelemetry Instrumentation for Java'
- packaging = 'jar'
url = 'https://github.com/open-telemetry/opentelemetry-java-instrumentation'
licenses {

MODIFY
settings.gradle
settings.gradle
@@ -40,6 +40,7 @@ include ':javaagent-tooling'
include ':javaagent'
include ':load-generator'
+include ':bom-alpha'
include ':instrumentation-api'
include ':javaagent-api'

Publish a BOM (#2339)