Skip to content

Commit

Permalink
Use the Gradle version catalog for common software versions to the ex…
Browse files Browse the repository at this point in the history
…tent that it can replace the versionMap. (opensearch-project#2253)

Signed-off-by: David Venable <[email protected]>
  • Loading branch information
dlvenable authored Feb 9, 2023
1 parent f782b66 commit a5e51a3
Show file tree
Hide file tree
Showing 24 changed files with 90 additions and 76 deletions.
12 changes: 0 additions & 12 deletions build-resources.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

//preferably try to maintain the alphabetical order
ext.versionMap = [
junitJupiter : '5.8.2',
mockito : '3.11.2',
opentelemetryProto : '0.16.0-alpha',
opensearchVersion : '1.3.7',
armeria: '1.20.3',
armeriaGrpc: '1.20.3',
protobufJavaUtil: '3.21.11',
protobufJava: '3.21.11'
]

ext.coreProjects = [
project(':data-prepper-api'),
project(':data-prepper-core'),
Expand Down
8 changes: 2 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,8 @@ subprojects {
implementation platform('io.micrometer:micrometer-bom:1.9.4')
implementation 'com.google.guava:guava:31.1-jre'
implementation 'org.slf4j:slf4j-api:2.0.5'
testImplementation platform("org.junit:junit-bom:${versionMap.junitJupiter}")
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.junit.vintage:junit-vintage-engine'
testImplementation "org.mockito:mockito-core:${versionMap.mockito}"
testImplementation "org.mockito:mockito-junit-jupiter:${versionMap.mockito}"

testImplementation testLibs.bundles.junit
testImplementation testLibs.bundles.mockito
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.awaitility:awaitility:4.2.0'
constraints {
Expand Down
6 changes: 3 additions & 3 deletions data-prepper-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ dependencies {
}
implementation 'software.amazon.cloudwatchlogs:aws-embedded-metrics:2.0.0-beta-1'
testImplementation 'org.springframework:spring-test:5.3.25'
implementation "com.linecorp.armeria:armeria:${versionMap.armeria}"
implementation libs.armeria.core
implementation libs.armeria.grpc
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation "com.linecorp.armeria:armeria-grpc:${versionMap.armeriaGrpc}"
implementation 'software.amazon.awssdk:acm'
implementation 'software.amazon.awssdk:s3'
implementation 'software.amazon.awssdk:apache-client'
implementation 'commons-validator:commons-validator:1.7'
implementation 'software.amazon.awssdk:servicediscovery'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
testImplementation "org.mockito:mockito-inline:${versionMap.mockito}"
testImplementation testLibs.mockito.inline
testImplementation 'org.apache.commons:commons-lang3:3.12.0'
testImplementation project(':data-prepper-api').sourceSets.test.output
}
Expand Down
2 changes: 1 addition & 1 deletion data-prepper-logstash-configuration/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies {
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation "org.apache.commons:commons-lang3:3.12.0"
testImplementation 'org.slf4j:slf4j-simple:2.0.5'
testImplementation "org.mockito:mockito-inline:${versionMap.mockito}"
testImplementation testLibs.mockito.inline
}

generateGrammarSource {
Expand Down
4 changes: 2 additions & 2 deletions data-prepper-plugins/aggregate-processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ dependencies {
implementation project(':data-prepper-plugins:otel-metrics-raw-processor')
implementation 'com.google.guava:guava:23.0'
implementation "org.apache.commons:commons-lang3:3.12.0"
implementation "io.opentelemetry.proto:opentelemetry-proto:${versionMap.opentelemetryProto}"
implementation libs.opentelemetry.proto
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'io.micrometer:micrometer-core'
testImplementation "org.mockito:mockito-inline:${versionMap.mockito}"
testImplementation testLibs.mockito.inline
}

jacocoTestCoverageVerification {
Expand Down
6 changes: 3 additions & 3 deletions data-prepper-plugins/armeria-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

dependencies {
implementation project(':data-prepper-api')
implementation "com.linecorp.armeria:armeria:${versionMap.armeria}"
implementation "com.linecorp.armeria:armeria-grpc:${versionMap.armeriaGrpc}"
testImplementation "com.linecorp.armeria:armeria-junit5:${versionMap.armeria}"
implementation libs.armeria.core
implementation libs.armeria.grpc
testImplementation libs.armeria.junit
}
2 changes: 1 addition & 1 deletion data-prepper-plugins/common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies {
implementation 'io.micrometer:micrometer-core'
testImplementation project(':data-prepper-plugins:blocking-buffer')
testImplementation 'commons-io:commons-io:2.11.0'
testImplementation "org.mockito:mockito-inline:${versionMap.mockito}"
testImplementation testLibs.mockito.inline
}

jacocoTestCoverageVerification {
Expand Down
2 changes: 1 addition & 1 deletion data-prepper-plugins/grok-processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation "io.krakens:java-grok:0.1.9"
implementation 'io.micrometer:micrometer-core'
testImplementation "org.mockito:mockito-inline:${versionMap.mockito}"
testImplementation testLibs.mockito.inline
testImplementation project(':data-prepper-test-common')
}

Expand Down
2 changes: 1 addition & 1 deletion data-prepper-plugins/http-source/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {
implementation project(':data-prepper-plugins:blocking-buffer')
implementation project(':data-prepper-plugins:common')
implementation project(':data-prepper-plugins:armeria-common')
implementation "com.linecorp.armeria:armeria:${versionMap.armeria}"
implementation libs.armeria.core
implementation 'commons-io:commons-io:2.11.0'
implementation 'software.amazon.awssdk:acm'
implementation 'software.amazon.awssdk:s3'
Expand Down
2 changes: 1 addition & 1 deletion data-prepper-plugins/opensearch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

buildscript {
ext {
opensearchVersion = System.getProperty('opensearch.version', "${versionMap.opensearchVersion}")
opensearchVersion = System.getProperty('opensearch.version', "${libs.versions.opensearch.get()}")
}

repositories {
Expand Down
4 changes: 2 additions & 2 deletions data-prepper-plugins/otel-logs-source/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies {
implementation 'commons-codec:commons-codec:1.15'
implementation project(':data-prepper-plugins:armeria-common')
testImplementation project(':data-prepper-api').sourceSets.test.output
implementation "io.opentelemetry.proto:opentelemetry-proto:${versionMap.opentelemetryProto}"
implementation libs.opentelemetry.proto
implementation "commons-io:commons-io:2.11.0"
implementation 'software.amazon.awssdk:acm'
implementation 'software.amazon.awssdk:auth'
Expand All @@ -30,7 +30,7 @@ dependencies {
implementation "org.bouncycastle:bcprov-jdk15on:1.69"
implementation "org.bouncycastle:bcpkix-jdk15on:1.69"
testImplementation 'org.assertj:assertj-core:3.21.0'
testImplementation "org.mockito:mockito-inline:${versionMap.mockito}"
testImplementation testLibs.mockito.inline
testImplementation "org.hamcrest:hamcrest:2.2"
testImplementation("commons-io:commons-io:2.10.0")
}
Expand Down
10 changes: 5 additions & 5 deletions data-prepper-plugins/otel-metrics-raw-processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ dependencies {
implementation 'commons-codec:commons-codec:1.15'
implementation 'org.apache.commons:commons-lang3:3.12.0'
testImplementation project(':data-prepper-api').sourceSets.test.output
implementation "io.opentelemetry.proto:opentelemetry-proto:${versionMap.opentelemetryProto}"
implementation "com.google.protobuf:protobuf-java-util:${versionMap.protobufJavaUtil}"
implementation "com.linecorp.armeria:armeria:${versionMap.armeria}"
implementation "com.linecorp.armeria:armeria-grpc:${versionMap.armeriaGrpc}"
implementation libs.opentelemetry.proto
implementation libs.protobuf.util
implementation libs.armeria.core
implementation libs.armeria.grpc
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
implementation group: 'com.google.guava', name: 'guava', version: '31.1-jre'
testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation "org.mockito:mockito-inline:${versionMap.mockito}"
testImplementation testLibs.mockito.inline
}

jacocoTestCoverageVerification {
Expand Down
10 changes: 5 additions & 5 deletions data-prepper-plugins/otel-metrics-source/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ dependencies {
implementation 'commons-codec:commons-codec:1.15'
implementation project(':data-prepper-plugins:armeria-common')
testImplementation project(':data-prepper-api').sourceSets.test.output
implementation "io.opentelemetry.proto:opentelemetry-proto:${versionMap.opentelemetryProto}"
implementation libs.opentelemetry.proto
implementation "commons-io:commons-io:2.11.0"
implementation 'software.amazon.awssdk:acm'
implementation 'software.amazon.awssdk:auth'
implementation 'software.amazon.awssdk:regions'
implementation 'software.amazon.awssdk:s3'
implementation "com.google.protobuf:protobuf-java-util:${versionMap.protobufJavaUtil}"
implementation "com.linecorp.armeria:armeria:${versionMap.armeria}"
implementation "com.linecorp.armeria:armeria-grpc:${versionMap.armeriaGrpc}"
implementation libs.protobuf.util
implementation libs.armeria.core
implementation libs.armeria.grpc
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
implementation "org.apache.commons:commons-lang3:3.12.0"
implementation "org.bouncycastle:bcprov-jdk15on:1.70"
implementation "org.bouncycastle:bcpkix-jdk15on:1.70"
testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation "org.mockito:mockito-inline:${versionMap.mockito}"
testImplementation testLibs.mockito.inline
testImplementation("commons-io:commons-io:2.10.0")
}

Expand Down
4 changes: 2 additions & 2 deletions data-prepper-plugins/otel-proto-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ plugins {

dependencies {
implementation project(':data-prepper-api')
implementation "io.opentelemetry.proto:opentelemetry-proto:${versionMap.opentelemetryProto}"
implementation "com.google.protobuf:protobuf-java-util:${versionMap.protobufJavaUtil}"
implementation libs.opentelemetry.proto
implementation libs.protobuf.util
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
implementation "org.apache.commons:commons-lang3:3.12.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

ext {
opensearchVersion = System.getProperty("opensearch.version", "${versionMap.opensearchVersion}")
opensearchVersion = System.getProperty("opensearch.version", "${libs.versions.opensearch.get()}")
}

dependencies {
Expand Down
10 changes: 5 additions & 5 deletions data-prepper-plugins/otel-trace-raw-processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ dependencies {
implementation project(':data-prepper-plugins:common')
implementation 'commons-codec:commons-codec:1.15'
testImplementation project(':data-prepper-api').sourceSets.test.output
implementation "io.opentelemetry.proto:opentelemetry-proto:${versionMap.opentelemetryProto}"
implementation "com.google.protobuf:protobuf-java-util:${versionMap.protobufJavaUtil}"
implementation "com.linecorp.armeria:armeria:${versionMap.armeria}"
implementation "com.linecorp.armeria:armeria-grpc:${versionMap.armeriaGrpc}"
implementation libs.opentelemetry.proto
implementation libs.protobuf.util
implementation libs.armeria.core
implementation libs.armeria.grpc
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
implementation 'com.google.guava:guava:31.1-jre'
testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation "org.mockito:mockito-inline:${versionMap.mockito}"
testImplementation testLibs.mockito.inline
}

jacocoTestCoverageVerification {
Expand Down
10 changes: 5 additions & 5 deletions data-prepper-plugins/otel-trace-source/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ dependencies {
implementation project(':data-prepper-plugins:otel-proto-common')
implementation 'commons-codec:commons-codec:1.15'
testImplementation project(':data-prepper-api').sourceSets.test.output
implementation "io.opentelemetry.proto:opentelemetry-proto:${versionMap.opentelemetryProto}"
implementation libs.opentelemetry.proto
implementation "commons-io:commons-io:2.11.0"
implementation 'software.amazon.awssdk:s3'
implementation 'software.amazon.awssdk:acm'
implementation "com.google.protobuf:protobuf-java-util:${versionMap.protobufJavaUtil}"
implementation "com.linecorp.armeria:armeria:${versionMap.armeria}"
implementation "com.linecorp.armeria:armeria-grpc:${versionMap.armeriaGrpc}"
implementation libs.protobuf.util
implementation libs.armeria.core
implementation libs.armeria.grpc
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
implementation "org.apache.commons:commons-lang3:3.12.0"
implementation "org.bouncycastle:bcprov-jdk15on:1.70"
implementation "org.bouncycastle:bcpkix-jdk15on:1.70"
testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation "org.mockito:mockito-inline:${versionMap.mockito}"
testImplementation testLibs.mockito.inline
testImplementation("commons-io:commons-io:2.10.0")
}

Expand Down
4 changes: 2 additions & 2 deletions data-prepper-plugins/peer-forwarder/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies {
implementation project(':data-prepper-api')
implementation project(':data-prepper-plugins:otel-proto-common')
testImplementation project(':data-prepper-api').sourceSets.test.output
implementation "io.opentelemetry.proto:opentelemetry-proto:${versionMap.opentelemetryProto}"
implementation libs.opentelemetry.proto
implementation "com.linecorp.armeria:armeria:1.9.2"
implementation "com.linecorp.armeria:armeria-grpc:1.9.2"
implementation 'com.amazonaws:aws-java-sdk-s3'
Expand All @@ -28,7 +28,7 @@ dependencies {
implementation "org.apache.commons:commons-lang3:3.12.0"
implementation "commons-validator:commons-validator:1.7"
testImplementation "org.hamcrest:hamcrest:2.2"
testImplementation "org.mockito:mockito-inline:${versionMap.mockito}"
testImplementation testLibs.mockito.inline
testImplementation "commons-io:commons-io:2.10.0"
testImplementation 'org.awaitility:awaitility:4.1.1'
}
Expand Down
6 changes: 3 additions & 3 deletions data-prepper-plugins/service-map-stateful/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ dependencies {
implementation 'commons-codec:commons-codec:1.15'
implementation 'io.micrometer:micrometer-core'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation("io.opentelemetry.proto:opentelemetry-proto:${versionMap.opentelemetryProto}") {
implementation(libs.opentelemetry.proto) {
exclude group: 'com.google.protobuf', module: 'protobuf-java'
}
implementation "com.google.protobuf:protobuf-java:${versionMap.protobufJava}"
testImplementation "org.mockito:mockito-inline:${versionMap.mockito}"
implementation libs.protobuf.core
testImplementation testLibs.mockito.inline
}

jacocoTestCoverageVerification {
Expand Down
2 changes: 1 addition & 1 deletion e2e-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ subprojects {
ext {
dataPrepperJarFilepath = "${project.buildDir.name}/bin/data-prepper/"
targetJavaVersion = project.hasProperty('endToEndJavaVersion') ? project.getProperty('endToEndJavaVersion') : '11'
targetOpenTelemetryVersion = project.hasProperty('openTelemetryVersion') ? project.getProperty('openTelemetryVersion') : "${versionMap.opentelemetryProto}"
targetOpenTelemetryVersion = project.hasProperty('openTelemetryVersion') ? project.getProperty('openTelemetryVersion') : "${libs.versions.opentelemetry.get()}"
dataPrepperBaseImage = "eclipse-temurin:${targetJavaVersion}-jre-alpine"
}
}
6 changes: 3 additions & 3 deletions e2e-test/log/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def removeDataPrepperDockerContainer(final DockerStopContainer stopDataPrepperDo
* OpenSearch Docker tasks
*/
task pullOpenSearchDockerImage(type: DockerPullImage) {
image = "opensearchproject/opensearch:${versionMap.opensearchVersion}"
image = "opensearchproject/opensearch:${libs.versions.opensearch.get()}"
}

task createOpenSearchDockerContainer(type: DockerCreateContainer) {
Expand Down Expand Up @@ -190,7 +190,7 @@ dependencies {
integrationTestImplementation project(':data-prepper-plugins:common')
integrationTestImplementation project(':data-prepper-plugins:log-generator-source')
integrationTestImplementation project(':data-prepper-plugins:opensearch')
integrationTestImplementation "com.linecorp.armeria:armeria:${versionMap.armeria}"
integrationTestImplementation libs.armeria.core
integrationTestImplementation "org.awaitility:awaitility:4.1.1"
integrationTestImplementation "org.opensearch.client:opensearch-rest-high-level-client:${versionMap.opensearchVersion}"
integrationTestImplementation libs.opensearch.rhlc
}
12 changes: 6 additions & 6 deletions e2e-test/peerforwarder/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def removeDataPrepperDockerContainer(final DockerStopContainer stopDataPrepperDo
* OpenSearch Docker tasks
*/
task pullOpenSearchDockerImage(type: DockerPullImage) {
image = "opensearchproject/opensearch:${versionMap.opensearchVersion}"
image = "opensearchproject/opensearch:${libs.versions.opensearch.get()}"
}

task createOpenSearchDockerContainer(type: DockerCreateContainer) {
Expand Down Expand Up @@ -205,10 +205,10 @@ dependencies {
integrationTestImplementation project(':data-prepper-plugins:opensearch')
integrationTestImplementation project(':data-prepper-plugins:otel-trace-group-processor')
integrationTestImplementation 'org.awaitility:awaitility:4.2.0'
integrationTestImplementation "io.opentelemetry.proto:opentelemetry-proto:${versionMap.opentelemetryProto}"
integrationTestImplementation "com.google.protobuf:protobuf-java-util:${versionMap.protobufJavaUtil}"
integrationTestImplementation "com.linecorp.armeria:armeria:${versionMap.armeria}"
integrationTestImplementation "com.linecorp.armeria:armeria-grpc:${versionMap.armeriaGrpc}"
integrationTestImplementation "org.opensearch.client:opensearch-rest-high-level-client:${versionMap.opensearchVersion}"
integrationTestImplementation libs.opentelemetry.proto
integrationTestImplementation libs.protobuf.util
integrationTestImplementation libs.armeria.core
integrationTestImplementation libs.armeria.grpc
integrationTestImplementation libs.opensearch.rhlc
integrationTestImplementation 'com.fasterxml.jackson.core:jackson-databind'
}
10 changes: 5 additions & 5 deletions e2e-test/trace/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def createDataPrepperDockerContainerFromPullImage(final String taskBaseName, fin
* OpenSearch Docker tasks
*/
task pullOpenSearchDockerImage(type: DockerPullImage) {
image = "opensearchproject/opensearch:${versionMap.opensearchVersion}"
image = "opensearchproject/opensearch:${libs.versions.opensearch.get()}"
}

task createOpenSearchDockerContainer(type: DockerCreateContainer) {
Expand Down Expand Up @@ -234,9 +234,9 @@ dependencies {
integrationTestImplementation project(':data-prepper-plugins:otel-trace-group-processor')
integrationTestImplementation 'org.awaitility:awaitility:4.2.0'
integrationTestImplementation "io.opentelemetry.proto:opentelemetry-proto:${targetOpenTelemetryVersion}"
integrationTestImplementation "com.google.protobuf:protobuf-java-util:${versionMap.protobufJavaUtil}"
integrationTestImplementation "com.linecorp.armeria:armeria:${versionMap.armeria}"
integrationTestImplementation "com.linecorp.armeria:armeria-grpc:${versionMap.armeriaGrpc}"
integrationTestImplementation "org.opensearch.client:opensearch-rest-high-level-client:${versionMap.opensearchVersion}"
integrationTestImplementation libs.protobuf.util
integrationTestImplementation libs.armeria.core
integrationTestImplementation libs.armeria.grpc
integrationTestImplementation libs.opensearch.rhlc
integrationTestImplementation 'com.fasterxml.jackson.core:jackson-databind'
}
Loading

0 comments on commit a5e51a3

Please sign in to comment.