Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ dependencies {
implementation("com.gradle.develocity:com.gradle.develocity.gradle.plugin:4.2.2")
implementation("me.champeau.gradle.japicmp:me.champeau.gradle.japicmp.gradle.plugin:0.4.6")
implementation("com.google.auto.value:auto-value-annotations:1.11.1")
implementation("com.gradleup.shadow:com.gradleup.shadow.gradle.plugin:9.2.2")
implementation("com.github.jk1.dependency-license-report:com.github.jk1.dependency-license-report.gradle.plugin:3.0.1")
implementation("org.cyclonedx.bom:org.cyclonedx.bom.gradle.plugin:3.1.0")
}

spotless {
Expand Down
6 changes: 6 additions & 0 deletions buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ java {
withSourcesJar()
}

tasks.named<Jar>("jar") {
from(rootProject.file("LICENSE")) {
into("META-INF")
}
}

tasks {
withType<JavaCompile>().configureEach {
with(options) {
Expand Down
97 changes: 97 additions & 0 deletions buildSrc/src/main/kotlin/otel.shadow-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.ReportRenderer
import com.github.jk1.license.render.TextReportRenderer
import com.github.jk1.license.task.CheckLicensePreparationTask
import com.github.jk1.license.task.CheckLicenseTask
import com.github.jk1.license.task.ReportTask

plugins {
id("com.gradleup.shadow")
id("org.cyclonedx.bom")
id("com.github.jk1.dependency-license-report")
}

// Temporary workaround until the license plugin supports configuration cache
tasks.withType<ReportTask>().configureEach {
notCompatibleWithConfigurationCache("Unsupported")
}
tasks.withType<CheckLicensePreparationTask>().configureEach {
notCompatibleWithConfigurationCache("Unsupported")
}
tasks.withType<CheckLicenseTask>().configureEach {
notCompatibleWithConfigurationCache("Unsupported")
}

licenseReport {
allowedLicensesFile = file(rootProject.file("config/dependency-license/allowed-licenses.json"))
excludes = arrayOf("opentelemetry-java-contrib:dependencyManagement")
filters = arrayOf(
LicenseBundleNormalizer(
rootProject.file("config/dependency-license/license-normalizer-bundle.json").absolutePath,
false
)
)
renderers = arrayOf<ReportRenderer>(
TextReportRenderer()
)
}

tasks.cyclonedxDirectBom {
xmlOutput.unsetConvention()
}

val copyLegalDocs = tasks.register<Copy>("copyLegalDocs") {
group = "documentation"
description = "Copies legal files and generated checkLicense/SBOM reports into resources."

from(layout.buildDirectory.file("reports/dependency-license/THIRD-PARTY-NOTICES.txt"))
from(layout.buildDirectory.file("reports/cyclonedx-direct/bom.json"))

into(layout.buildDirectory.dir("generated/legal-docs"))

rename("bom.json", "SBOM.json")
}

copyLegalDocs.configure {
tasks.findByName("cyclonedxDirectBom")?.let { dependsOn(it) }
tasks.findByName("checkLicense")?.let { dependsOn(it) }
}

tasks.named<ShadowJar>("shadowJar") {
dependsOn(copyLegalDocs)

transform<com.github.jengelman.gradle.plugins.shadow.transformers.ApacheNoticeResourceTransformer>()

manifest {
attributes["Implementation-Version"] = project.version
}

// Prevent dependency-provided LICENSE/NOTICE files from being copied into the
// distribution (they often duplicate or conflict). We still include the
// project"s own `LICENSE` explicitly below.
exclude(
"DISCLAIMER",
"license.header",
"licenses/**",
"META-INF/DEPENDENCIES",
"META-INF/NOTICE.md",
"META-INF/NOTICE",
"META-INF/NOTICE.md",
"META-INF/licenses/**",
"META-INF/LICENSE*",
"**/NOTICE*"
)

from(layout.buildDirectory.dir("generated/legal-docs")) {
into("META-INF/licenses")
}

from(rootProject.file("LICENSE")) {
into("META-INF")
}
}

tasks.named<Task>("assemble") {
dependsOn("shadowJar")
}
2 changes: 1 addition & 1 deletion cel-sampler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The `CelBasedSampler` supports [declarative configuration](https://opentelemetry

To use:

* Add a dependency on `io.opentelemetry.contrib:opentelemetry-cel-sampler:<version>`
* Add a dependency on `io.opentelemetry.contrib:opentelemetry-cel-sampler-dist:<version>`
* See the [extension documentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/examples/extension/README.md#build-and-add-extensions) for how to add extensions when using the java agent.
* Follow the [instructions](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/incubator/README.md#declarative-configuration) to configure OpenTelemetry with declarative configuration.
* Configure the `.tracer_provider.sampler` to include the `cel_based` sampler.
Expand Down
7 changes: 7 additions & 0 deletions cel-sampler/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
id("otel.java-conventions")
id("otel.shadow-conventions")
id("otel.publish-conventions")
}

Expand All @@ -18,3 +21,7 @@ dependencies {
testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
testImplementation("io.opentelemetry:opentelemetry-sdk-extension-incubator")
}

tasks.named<ShadowJar>("shadowJar") {
archiveClassifier.set("dist")
}
38 changes: 38 additions & 0 deletions config/dependency-license/allowed-licenses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"allowedLicenses": [
{
"moduleLicense": "Apache License, Version 2.0"
},
{
"moduleLicense": "Bouncy Castle Licence"
},
{
"moduleLicense": "The 3-Clause BSD License"
},
{
"moduleLicense": "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0"
},
{
"moduleLicense": "GNU LESSER GENERAL PUBLIC LICENSE, Version 3"
},
{
"moduleLicense": "GNU Lesser General Public License Version 3 or greater"
},
{
"moduleLicense": "Go License"
},
{
"moduleLicense": "MIT License"
},
{
"moduleLicense": "PUBLIC DOMAIN"
},
{
"moduleVersion": "1.0",
"moduleName": "net.jcip:jcip-annotations"
},
{
"moduleName": "opentelemetry-java-contrib:dependencyManagement"
}
]
}
96 changes: 96 additions & 0 deletions config/dependency-license/license-normalizer-bundle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"bundles" : [
{ "bundleName" : "Apache-1.1", "licenseName" : "Apache Software License, Version 1.1", "licenseUrl" : "https://www.apache.org/licenses/LICENSE-1.1" },
{ "bundleName" : "Apache-2.0", "licenseName" : "Apache License, Version 2.0", "licenseUrl" : "https://www.apache.org/licenses/LICENSE-2.0" },
{ "bundleName" : "0BSD", "licenseName" : "BSD Zero Clause License", "licenseUrl" : "https://opensource.org/licenses/0BSD" },
{ "bundleName" : "BSD-2-Clause", "licenseName" : "The 2-Clause BSD License", "licenseUrl" : "https://opensource.org/licenses/BSD-2-Clause" },
{ "bundleName" : "BSD-3-Clause", "licenseName" : "The 3-Clause BSD License", "licenseUrl" : "https://opensource.org/licenses/BSD-3-Clause" },
{ "bundleName" : "CC0-1.0", "licenseName" : "Creative Commons Legal Code", "licenseUrl" : "https://creativecommons.org/publicdomain/zero/1.0/legalcode" },
{ "bundleName" : "CC-BY-2.5", "licenseName": "Creative Commons Attribution Non Commercial 2.5 Generic", "licenseUrl": "https://creativecommons.org/licenses/by/2.5" },
{ "bundleName" : "CDDL-1.0", "licenseName" : "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0", "licenseUrl" : "https://oss.oracle.com/licenses/CDDL" },
{ "bundleName" : "CDDL-1.1", "licenseName" : "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1", "licenseUrl" : "https://oss.oracle.com/licenses/CDDL-1.1" },
{ "bundleName" : "CPL-1.0", "licenseName" : "Common Public License - v 1.0", "licenseUrl" : "https://www.eclipse.org/legal/cpl-v10.html" },
{ "bundleName" : "EPL-1.0", "licenseName" : "Eclipse Public License - v 1.0", "licenseUrl" : "http://www.eclipse.org/legal/epl-v10.html" },
{ "bundleName" : "EPL-2.0", "licenseName" : "Eclipse Public License - v 2.0", "licenseUrl" : "https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt" },
{ "bundleName" : "EDL-1.0", "licenseName" : "Eclipse Distribution License - v 1.0", "licenseUrl" : "https://www.eclipse.org/org/documents/edl-v10.html" },
{ "bundleName" : "Go", "licenseName" : "Go License", "licenseUrl": "https://golang.org/LICENSE" },
{ "bundleName" : "GPL-1.0", "licenseName" : "GNU GENERAL PUBLIC LICENSE, Version 1", "licenseUrl" : "https://www.gnu.org/licenses/gpl-1.0" },
{ "bundleName" : "GPL-2.0-only", "licenseName" : "GNU GENERAL PUBLIC LICENSE, Version 2", "licenseUrl" : "https://www.gnu.org/licenses/gpl-2.0" },
{ "bundleName" : "GPL-3.0-only", "licenseName" : "GNU GENERAL PUBLIC LICENSE, Version 3", "licenseUrl" : "https://www.gnu.org/licenses/gpl-3.0" },
{ "bundleName" : "GPL-2.0 WITH Classpath-exception-2.0", "licenseName" : "GNU GENERAL PUBLIC LICENSE, Version 2 + Classpath Exception", "licenseUrl" : "https://openjdk.java.net/legal/gplv2+ce.html" },
{ "bundleName" : "LGPL-2.1-only", "licenseName" : "GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1", "licenseUrl" : "https://www.gnu.org/licenses/lgpl-2.1" },
{ "bundleName" : "LGPL-3.0-only", "licenseName" : "GNU LESSER GENERAL PUBLIC LICENSE, Version 3", "licenseUrl" : "https://www.gnu.org/licenses/lgpl-3.0" },
{ "bundleName" : "LGPL-3.0-or-greater", "licenseName" : "GNU Lesser General Public License Version 3 or greater", "licenseUrl": "http://www.gnu.org/licenses/lgpl.html" },
{ "bundleName" : "MIT", "licenseName" : "MIT License", "licenseUrl" : "https://opensource.org/licenses/MIT" },
{ "bundleName" : "MPL-1.1", "licenseName" : "Mozilla Public License Version 1.1", "licenseUrl" : "https://www.mozilla.org/en-US/MPL/1.1" },
{ "bundleName" : "MPL-2.0", "licenseName" : "Mozilla Public License, Version 2.0", "licenseUrl" : "https://www.mozilla.org/en-US/MPL/2.0" },
{ "bundleName" : "Public-Domain", "licenseName" : "PUBLIC DOMAIN", "licenseUrl" : "" }
],
"transformationRules" : [
{ "bundleName" : "0BSD", "licenseNamePattern" : "BSD Zero Clause License" },
{ "bundleName" : "0BSD", "licenseNamePattern" : "BSD$" },
{ "bundleName" : "0BSD", "licenseNamePattern" : "BSD( |-)clause.*" },
{ "bundleName" : "0BSD", "licenseNamePattern" : "BSD( |-)license.*" },
{ "bundleName" : "Apache-2.0", "licenseNamePattern" : ".*The Apache Software License, Version 2\\.0.*" },
{ "bundleName" : "Apache-2.0", "licenseNamePattern" : ".*?Apache( |-|_)2.*" },
{ "bundleName" : "Apache-2.0", "licenseNamePattern" : "ASL 2\\.0" },
{ "bundleName" : "Apache-2.0", "licenseNamePattern" : ".*Apache License,?( Version)? 2.*" },
{ "bundleName" : "Apache-2.0", "licenseUrlPattern" : ".*(www\\.)?opensource\\.org/licenses/Apache-2\\.0.*" },
{ "bundleName" : "Apache-2.0", "licenseUrlPattern" : ".*www\\.apache\\.org/licenses/LICENSE-2\\.0.*" },
{ "bundleName" : "Apache-2.0", "modulePattern": "opentelemetry-java-contrib:dependencyManagement" },
{ "bundleName" : "LGPL-2.1-only", "licenseUrlPattern" : ".*www\\.gnu\\.org/licenses/old-licenses/lgpl-2\\.1\\.html" },
{ "bundleName" : "Apache-2.0", "licenseFileContentPattern" : ".*Apache License,?( Version)? 2.*" },
{ "bundleName" : "Apache-1.1", "licenseFileContentPattern" : ".*Apache Software License, Version 1\\.1.*" },
{ "bundleName" : "CC0-1.0", "licenseNamePattern" : "CC0(( |-)1(\\.0)?)?" },
{ "bundleName" : "CC0-1.0", "licenseUrlPattern" : ".*(www\\.)?creativecommons\\.org/publicdomain/zero/1\\.0/" },
{ "bundleName" : "CDDL-1.0", "licenseFileContentPattern" : ".*CDDL.*1\\.0" },
{ "bundleName" : "CDDL-1.0", "licenseUrlPattern" : ".*CDDL.*.?1\\.0" },
{ "bundleName" : "CDDL-1.1", "licenseUrlPattern" : ".*CDDL.*.?1\\.1" },
{ "bundleName" : "CDDL-1.0", "licenseNamePattern" : "Common Development and Distribution License( \\(CDDL\\),?)? (version )?(.?\\s?)?1\\.0" },
{ "bundleName" : "CDDL-1.1", "licenseNamePattern" : "Common Development and Distribution License( \\(CDDL\\),?)? (version )?(.?\\s?)?1\\.1" },
{ "bundleName" : "BSD-3-Clause", "licenseNamePattern" : ".*BSD( |-)3-clause.*" },
{ "bundleName" : "BSD-3-Clause", "licenseUrlPattern" : ".*(www\\.)?opensource\\.org/licenses/BSD-3-Clause" },
{ "bundleName" : "BSD-3-Clause", "licenseNamePattern" : ".*?(The )New BSD License.*" },
{ "bundleName" : "BSD-3-Clause", "licenseNamePattern" : ".*?Modified BSD License.*" },
{ "bundleName" : "BSD-2-Clause", "licenseNamePattern" : "BSD( |-)2-clause.*" },
{ "bundleName" : "BSD-2-Clause", "licenseUrlPattern" : ".*(www\\.)?opensource\\.org/licenses/BSD-2-Clause" },
{ "bundleName" : "BSD-2-Clause", "licenseUrlPattern" : ".*(www\\.)?opensource\\.org/licenses/bsd-license(\\.php)?" },
{ "bundleName" : "CDDL-1.0", "licenseNamePattern" : "Common Development and Distribution( License)?" },
{ "bundleName" : "CDDL-1.0", "licenseNamePattern" : "CDDL 1(\\.0)" },
{ "bundleName" : "CDDL-1.1", "licenseNamePattern" : "CDDL 1\\.1" },
{ "bundleName" : "CDDL-1.1", "licenseUrlPattern" : ".*(www\\.).opensource\\.org/licenses/CDDL-1\\.0" },
{ "bundleName" : "EPL-1.0", "licenseNamePattern" : "Eclipse Publish License.*(v|version)\\.?\\s?1(\\.?0)?" },
{ "bundleName" : "EPL-1.0", "licenseNamePattern" : "Eclipse Public License.*(v|version)\\.?\\s?1(\\.?0)?" },
{ "bundleName" : "EPL-2.0", "licenseNamePattern" : "Eclipse Public License.*(v|version)\\.?\\s?2(\\.?0)?" },
{ "bundleName" : "EPL-2.0", "licenseUrlPattern" : ".*(www\\.).opensource\\.org/licenses/EPL-2\\.0" },
{ "bundleName" : "EPL-2.0", "licenseUrlPattern" : ".*http.?://www\\.eclipse\\.org/legal/epl-.?2\\.?0.*" },
{ "bundleName" : "EPL-2.0", "licenseUrlPattern" : ".*http.?://www\\.eclipse\\.org/org.*/epl-.?2\\.?0.*" },
{ "bundleName" : "EPL-2.0", "licenseUrlPattern" : ".*http.?://projects\\.eclipse\\.org/.*/epl-.?2\\.?0.*" },
{ "bundleName" : "EDL-1.0", "licenseNamePattern" : "Eclipse Distribution License.*(v|version)\\.?\\s?1(\\.0)?" },
{ "bundleName" : "EDL-1.0", "licenseUrlPattern" : ".*http.?://(www\\.)?eclipse\\.org/org.*/edl-.?1\\.?0.*" },
{ "bundleName" : "Go", "licenseUrlPattern" : "https?://golang.org/LICENSE" },
{ "bundleName" : "GPL-2.0-only", "licenseUrlPattern" : ".*(www\\.)?opensource\\.org/licenses/GPL-2\\.0" },
{ "bundleName" : "GPL-2.0 WITH Classpath-exception-2.0", "licenseNamePattern" : "GNU General Public License, version 2.*classpath exception" },
{ "bundleName" : "GPL-2.0 WITH Classpath-exception-2.0", "licenseNamePattern" : "GNU General Public License, version 2.*cp?e" },
{ "bundleName" : "GPL-2.0 WITH Classpath-exception-2.0", "licenseNamePattern" : "GNU General Public License, version 2.*, with the classpath exception" },
{ "bundleName" : "GPL-2.0 WITH Classpath-exception-2.0", "licenseNamePattern" : "GPL2 w/ CPE" },
{ "bundleName" : "GPL-3.0-only", "licenseUrlPattern" : ".*(www\\.)?opensource\\.org/licenses/GPL-3\\.0" },
{ "bundleName" : "LGPL-2.1-only", "licenseUrlPattern" : ".*(www\\.)?opensource\\.org/licenses/LGPL-2\\.1" },
{ "bundleName" : "LGPL-2.1-only", "licenseUrlPattern" : ".*(www\\.)?gnu\\.org/licenses(/old-licenses)?/lgpl-2\\.1(\\.(html|txt))?" },
{ "bundleName" : "LGPL-2.1-only", "licenseNamePattern" : "LGPL 2\\.1" },
{ "bundleName" : "LGPL-2.1-only", "licenseNamePattern" : "LGPL.*(v|version)\\.?\\s?2\\.1" },
{ "bundleName" : "LGPL-2.1-only", "licenseUrlPattern" : ".*(www\\.)?repository.jboss.org/licenses/lgpl-2.1\\.txt" },
{ "bundleName" : "LGPL-3.0-only", "licenseUrlPattern" : ".*(www\\.).opensource\\.org/licenses/LGPL-3\\.0" },
{ "bundleName" : "LGPL-3.0-only", "licenseNamePattern" : "lgplv?3" },
{ "bundleName" : "LGPL-3.0-only", "licenseUrlPattern" : ".*(www\\.)?gnu\\.org/licenses(/old-licenses)?/lgpl(-3)?(\\.(html|txt))?" },
{ "bundleName" : "MIT", "licenseNamePattern" : "Bouncy Castle Licence" },
{ "bundleName" : "MIT", "licenseNamePattern" : "(The\\s)?MIT(\\slicen(c|s)e)?(\\s\\(MIT\\))?" },
{ "bundleName" : "MIT", "licenseUrlPattern" : ".*(www\\.)?opensource\\.org/licenses/MIT(\\.php)?" },
{ "bundleName" : "MPL-1.1", "licenseNamePattern" : "MPL 1\\.1" },
{ "bundleName" : "MPL-2.0", "licenseUrlPattern" : ".*(www\\.).opensource\\.org/licenses/MPL-2\\.0" },
{ "bundleName" : "Public-Domain", "licenseNamePattern" : "((public)\\s(domain)).*", "transformUrl" : false },
{ "bundleName" : "Public-Domain", "licenseFileContentPattern" : ".*(Creative)\\s(Commons).*", "transformUrl" : false },
{ "bundleName" : "Public-Domain", "licenseFileContentPattern" : ".*((Public)\\s(Domain)).*", "transformUrl" : false },
{ "bundleName" : "CC-BY-2.5", "modulePattern": "net.jcip:jcip-annotations:1\\.0" }
]
}
2 changes: 1 addition & 1 deletion gcp-auth-extension/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("otel.java-conventions")
id("otel.shadow-conventions")
id("otel.publish-conventions")
id("com.gradleup.shadow")
}

description = "OpenTelemetry extension that provides GCP authentication support for OTLP exporters"
Expand Down
6 changes: 5 additions & 1 deletion ibm-mq-metrics/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
application
id("com.gradleup.shadow")
id("otel.java-conventions")
id("otel.shadow-conventions")
id("otel.publish-conventions")
}

Expand Down Expand Up @@ -62,6 +62,10 @@ testing {
}
}

licenseReport {
excludes = arrayOf("com.ibm.mq:com.ibm.mq.allclient")
}

tasks.shadowJar {
dependencies {
exclude(dependency("com.ibm.mq:com.ibm.mq.allclient"))
Expand Down
2 changes: 1 addition & 1 deletion jmx-metrics/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("otel.java-conventions")
application
id("com.gradleup.shadow")
id("otel.shadow-conventions")

id("otel.groovy-conventions")
id("otel.publish-conventions")
Expand Down
2 changes: 1 addition & 1 deletion maven-extension/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("java")
id("com.gradleup.shadow")
id("otel.shadow-conventions")
id("otel.java-conventions")
id("otel.publish-conventions")
}
Expand Down