From 6503966b910ef0c70e455b5fa61c3c1e7ba2292a Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Tue, 19 Sep 2023 16:13:53 +0200 Subject: [PATCH] WIP --- .github/dependabot.yml | 57 ++++++++++++++-- build.gradle | 11 ++++ dependencies.gradle | 50 +++++++------- gradle/libs.versions.toml | 66 +++++++++++++++++++ .../build.gradle | 2 +- .../build.gradle | 4 +- .../build.gradle | 4 +- .../build.gradle | 2 +- micrometer-tracing/build.gradle | 12 ++-- 9 files changed, 164 insertions(+), 44 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8809b895..0d45867a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,19 +5,62 @@ registries: url: https://plugins.gradle.org/m2 username: dummy # Required by dependabot password: dummy # Required by dependabot + maven-central: + type: maven-repository + url: https://repo1.maven.org/maven2/ + username: dummy # Required by dependabot + password: dummy # Required by dependabot updates: - - package-ecosystem: "gradle" + - package-ecosystem: "github-actions" directory: "/" target-branch: "1.0.x" # oldest OSS supported branch - allow: - - dependency-name: "com.gradle*" - registries: - - gradle-plugin-portal schedule: interval: "weekly" - open-pull-requests-limit: 10 - package-ecosystem: "github-actions" directory: "/" - target-branch: "1.0.x" # oldest OSS supported branch + target-branch: "1.1.x" # oldest OSS supported branch + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + target-branch: "main" schedule: interval: "weekly" + - package-ecosystem: gradle + directory: / + schedule: + interval: daily + target-branch: 1.0.x + ignore: + # only upgrade patch versions for maintenance branch + - dependency-name: "*" + update-types: + - version-update:semver-major + - version-update:semver-minor + registries: + - gradle-plugin-portal + - maven-central + - package-ecosystem: gradle + directory: / + schedule: + interval: daily + target-branch: 1.1.x + ignore: + # only upgrade patch versions for maintenance branch + - dependency-name: "*" + update-types: + - version-update:semver-major + - version-update:semver-minor + registries: + - gradle-plugin-portal + - maven-central + - package-ecosystem: gradle + directory: / + schedule: + interval: daily + target-branch: main + ignore: + # only upgrade by minor or patch + - dependency-name: "*" + update-types: + - version-update:semver-major diff --git a/build.gradle b/build.gradle index 9c8418dc..38a3ec2d 100644 --- a/build.gradle +++ b/build.gradle @@ -28,6 +28,17 @@ buildscript { configurations.classpath.resolutionStrategy.cacheDynamicVersionsFor 0, 'minutes' } +plugins { + alias libs.plugins.license apply false + alias libs.plugins.nebulaRelease + alias libs.plugins.nebulaPublishing apply false + alias libs.plugins.nebulaProject apply false + alias libs.plugins.noHttp + alias libs.plugins.nexusPublish + alias libs.plugins.javaformat + alias libs.plugins.jmh +} + // TODO: remove this hack, see: https://github.com/nebula-plugins/nebula-release-plugin/issues/213 def releaseStage = findProperty('release.stage') apply plugin: 'nebula.release' diff --git a/dependencies.gradle b/dependencies.gradle index 25a997cc..8e7ddcc1 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,43 +1,43 @@ def VERSIONS = [ - 'javax.servlet:javax.servlet-api:latest.release', - 'jakarta.platform:jakarta.jakartaee-web-api:9.+', + libs.javaxServlet, + libs.jakartaWeb, - 'io.micrometer:context-propagation:1.0.+', + libs.micrometerContextPropagation, - 'aopalliance:aopalliance:1.0', + libs.aopAlliance, // logging - 'ch.qos.logback:logback-classic:1.2.+', - 'org.apache.logging.log4j:log4j-core:2.+', - 'org.slf4j:slf4j-api:1.7.+', + libs.logback, + libs.log4j, + libs.slf4j, // otel - 'io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:1.19.+', + libs.otelInstrumentation, // zipkin - 'io.zipkin.aws:brave-propagation-aws:latest.release', + libs.zipkinAws, // wavefront - 'com.wavefront:wavefront-sdk-java:3.0.+', - 'com.wavefront:wavefront-internal-reporter-java:1.7.+', + libs.wavefrontSdk, + libs.wavefrontReporter, // test - 'org.assertj:assertj-core:latest.release', - 'org.awaitility:awaitility:latest.release', - 'org.mockito:mockito-core:latest.release', - 'org.mockito:mockito-inline:latest.release', - 'org.mockito:mockito-junit-jupiter:latest.release', - 'com.github.tomakehurst:wiremock-jre8-standalone:latest.release', - 'org.testcontainers:testcontainers:latest.release', - 'org.testcontainers:junit-jupiter:latest.release' + libs.assertj, + libs.awaitility, + libs.mockitoCore, + libs.mockitoInline, + libs.mockitoJunit, + libs.wiremock, + libs.testcontainers, + libs.testcontainersJunit ] def MICROMETER_PLATFORM_VERSIONS = [ - 'io.micrometer:micrometer-bom:1.10.+' + libs.micrometerBom ] def PLATFORM_VERSIONS = [ - 'io.zipkin.brave:brave-bom:5.14.+', + libs.braveBom, // opentelemetry-instrumentation-api dependency above with this - 'io.opentelemetry:opentelemetry-bom:1.19.+', - 'io.opentelemetry:opentelemetry-bom-alpha:1.19.+', - 'io.projectreactor:reactor-bom:2022.0.8', - 'org.junit:junit-bom:5.10.+' + libs.otelBom, + libs.otelBomAlpha, + libs.reactorBom, + libs.junitBom ] subprojects { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..346460a1 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,66 @@ +[versions] +micrometer = "1.10.9" +junit = "5.10.0" +asmForPlugins = "7.3.1" +javaFormatForPlugins = "0.0.39" +jsr305 = "3.0.2" +javaxServlet="4.0.1" +micrometerContextPropagation="1.0.6-SNAPSHOT" +jakartaWeb="9.1.0" +otelInstrumentation="1.19.2-alpha" +aopalliance="1.0" +zipkinAws="0.23.5" +otelBom="1.19.0" +logback = "1.2.13" +wavefrontSdk="3.0.4" +otelBomAlpha="1.19.0-alpha" +log4j = "2.20.0" +wavefrontReporter="1.7.16" +slf4j = "1.7.36" +assertj = "3.24.2" +awaitility = "4.2.0" +mockito = "5.5.0" +wiremock = "2.35.0" +testcontainers = "1.19.0" +braveBom = "5.14.1" +reactorBom = "2022.0.8" + +[libraries] +aopAlliance = { module = "aopalliance:aopalliance", version.ref = "aopalliance" } +assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } +awaitility = { module = "'org.awaitility:awaitility", version.ref = "awaitility" } +braveBom = { module = "io.zipkin.brave:brave-bom", version.ref = "braveBom" } +jakartaWeb = { module = "jakarta.platform:jakarta.jakartaee-web-api", version.ref = "jakartaWeb" } +javaxServlet = { module = "javax.servlet:javax.servlet-api", version.ref = "javaxServlet" } +log4j = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } +logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } +micrometerContextPropagation = { module = "io.micrometer:context-propagation", version.ref = "micrometerContextPropagation" } +micrometerBom = { module = "io.micrometer:micrometer-bom", version.ref = "micrometer" } +mockitoCore = { module = "org.mockito:mockito-core", version.ref = "mockito" } +mockitoInline = { module = "org.mockito:mockito-inline", version.ref = "mockito" } +mockitoJunit = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito" } +otelBom = { module = "io.opentelemetry:opentelemetry-bom", version.ref = "otelBom" } +otelBomAlpha = { module = "io.opentelemetry:opentelemetry-bom-alpha", version.ref = "otelBomAlpha" } +otelInstrumentation = { module = "io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv", version.ref = "otelInstrumentation" } +reactorBom = { module = "io.projectreactor:reactor-bom", version.ref = "reactorBom" } +slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } +testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "testcontainers" } +testcontainersJunit = { module = "org.testcontainers:junit-jupiter", version.ref = "testcontainers" } +wavefrontSdk = { module = "com.wavefront:wavefront-sdk-java", version.ref = "wavefrontSdk" } +wavefrontReporter = { module = "com.wavefront:wavefront-internal-reporter-java", version.ref = "wavefrontReporter" } +wiremock = { module = "com.github.tomakehurst:wiremock-jre8-standalone", version.ref = "wiremock" } +zipkinAws = { module = "io.zipkin.aws:brave-propagation-aws", version.ref = "zipkinAws" } +junitBom = { module = "org.junit:junit-bom", version.ref = "junit" } +asmForPlugins = { module = "org.ow2.asm:asm", version.ref = "asmForPlugins" } +javaFormatForPlugins = { module = "io.spring.javaformat:spring-javaformat-checkstyle", version.ref = "javaFormatForPlugins" } +jsr305 = { module = "com.google.code.findbugs:jsr305", version.ref = "jsr305" } + +[plugins] +license = { id = "com.github.hierynomus.license", version = "0.16.1" } +nebulaRelease = { id = "nebula.release", version = "16.1.0" } +nebulaPublishing = { id = "com.netflix.nebula.maven-nebula-publish", version = "20.1.0" } +nebulaProject = { id = "com.netflix.nebula.project", version = "10.1.2" } +noHttp = { id = "io.spring.nohttp", version = "0.0.11" } +nexusPublish = { id = "io.github.gradle-nexus.publish-plugin", version = "1.3.0" } +javaformat = { id = "io.spring.javaformat", version = "0.0.39" } +jmh = { id = "me.champeau.jmh", version = "0.7.1" } diff --git a/micrometer-tracing-bridges/micrometer-tracing-bridge-brave/build.gradle b/micrometer-tracing-bridges/micrometer-tracing-bridge-brave/build.gradle index 0b64b5da..dc191148 100644 --- a/micrometer-tracing-bridges/micrometer-tracing-bridge-brave/build.gradle +++ b/micrometer-tracing-bridges/micrometer-tracing-bridge-brave/build.gradle @@ -20,7 +20,7 @@ dependencies { testImplementation 'io.micrometer:micrometer-core' testImplementation 'io.micrometer:micrometer-observation-test' testImplementation 'org.junit.jupiter:junit-jupiter' - testImplementation 'org.assertj:assertj-core' + testImplementation libs.assertj testImplementation 'org.awaitility:awaitility' testImplementation 'io.zipkin.brave:brave-instrumentation-http-tests' testImplementation 'ch.qos.logback:logback-classic' diff --git a/micrometer-tracing-bridges/micrometer-tracing-bridge-otel/build.gradle b/micrometer-tracing-bridges/micrometer-tracing-bridge-otel/build.gradle index 1fa4559f..7c602992 100644 --- a/micrometer-tracing-bridges/micrometer-tracing-bridge-otel/build.gradle +++ b/micrometer-tracing-bridges/micrometer-tracing-bridge-otel/build.gradle @@ -22,8 +22,8 @@ dependencies { testImplementation 'io.micrometer:micrometer-core' testImplementation 'io.micrometer:micrometer-observation-test' testImplementation 'org.junit.jupiter:junit-jupiter' - testImplementation 'org.assertj:assertj-core' + testImplementation libs.assertj testImplementation 'org.awaitility:awaitility' - testImplementation 'org.mockito:mockito-core' + testImplementation libs.mockitoCore testImplementation 'io.projectreactor:reactor-core' } diff --git a/micrometer-tracing-reporters/micrometer-tracing-reporter-wavefront/build.gradle b/micrometer-tracing-reporters/micrometer-tracing-reporter-wavefront/build.gradle index 3ea7642b..3a5adcdb 100644 --- a/micrometer-tracing-reporters/micrometer-tracing-reporter-wavefront/build.gradle +++ b/micrometer-tracing-reporters/micrometer-tracing-reporter-wavefront/build.gradle @@ -30,8 +30,8 @@ dependencies { // Tests testImplementation project(':micrometer-tracing-test') testImplementation 'org.junit.jupiter:junit-jupiter' - testImplementation 'org.assertj:assertj-core' + testImplementation libs.assertj testImplementation 'org.awaitility:awaitility' testImplementation 'ch.qos.logback:logback-classic' - testImplementation 'org.mockito:mockito-core' + testImplementation libs.mockitoCore } diff --git a/micrometer-tracing-tests/micrometer-tracing-integration-test/build.gradle b/micrometer-tracing-tests/micrometer-tracing-integration-test/build.gradle index 9bf865f0..7e44ac6b 100644 --- a/micrometer-tracing-tests/micrometer-tracing-integration-test/build.gradle +++ b/micrometer-tracing-tests/micrometer-tracing-integration-test/build.gradle @@ -47,7 +47,7 @@ dependencies { api 'org.assertj:assertj-core' // Tests for tests - testImplementation 'org.mockito:mockito-core' + testImplementation libs.mockitoCore testImplementation 'com.github.tomakehurst:wiremock-jre8-standalone' testImplementation 'org.awaitility:awaitility' testImplementation 'ch.qos.logback:logback-classic' diff --git a/micrometer-tracing/build.gradle b/micrometer-tracing/build.gradle index 105de420..f0080604 100644 --- a/micrometer-tracing/build.gradle +++ b/micrometer-tracing/build.gradle @@ -5,17 +5,17 @@ plugins { dependencies { api 'io.micrometer:micrometer-observation' api 'io.micrometer:context-propagation' - api 'aopalliance:aopalliance' + api libs.aopAlliance // exemplars support optionalApi 'io.micrometer:micrometer-core' // log monitoring - optionalApi 'ch.qos.logback:logback-classic' - optionalApi 'org.apache.logging.log4j:log4j-core' + optionalApi libs.logback + optionalApi libs.log4j testImplementation 'org.junit.jupiter:junit-jupiter' - testImplementation 'org.assertj:assertj-core' - testImplementation 'org.mockito:mockito-core' - testImplementation 'org.mockito:mockito-junit-jupiter' + testImplementation libs.assertj + testImplementation libs.mockitoCore + testImplementation libs.mockitoJunit }