/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

dependencyManagement {
  imports {
    mavenBom 'com.amazonaws:aws-java-sdk-bom:' + awsVersion
  }
}

ext.externalDependency = [
    "antlrRuntime": "org.antlr:antlr-runtime:3.5.2",
    "assertj": "org.assertj:assertj-core:3.20.2",
    "avro": "org.apache.avro:avro:" + avroVersion,
    "avroMapredH2": "org.apache.avro:avro-mapred:" + avroVersion,
    "avroCompatHelper": "com.linkedin.avroutil1:helper-all:0.2.117",
    "avroCompiler": "org.apache.avro:avro-compiler:" + avroVersion,
    "awsCore": "com.amazonaws:aws-java-sdk-core:" + awsVersion,
    "awsAsg": "com.amazonaws:aws-java-sdk-autoscaling:" + awsVersion,
    "awsAppAsg": "com.amazonaws:aws-java-sdk-applicationautoscaling:" + awsVersion,
    "awsEc2": "com.amazonaws:aws-java-sdk-ec2:" + awsVersion,
    "awsIam": "com.amazonaws:aws-java-sdk-iam:" + awsVersion,
    "awsS3": "com.amazonaws:aws-java-sdk-s3:" + awsVersion,
    "awsSts": "com.amazonaws:aws-java-sdk-sts:" + awsVersion,
    "commonsCli": "commons-cli:commons-cli:1.3.1",
    "commonsCodec": "commons-codec:commons-codec:1.10",
    "commonsEmail": "org.apache.commons:commons-email:1.4",
    "commonsLang": "commons-lang:commons-lang:2.6",
    "commonsLang3": "org.apache.commons:commons-lang3:3.4",
    "commonsCollections4": "org.apache.commons:commons-collections4:4.4",
    "commonsConfiguration": "commons-configuration:commons-configuration:1.10",
    "commonsIo": "commons-io:commons-io:2.5",
    "commonsMath": "org.apache.commons:commons-math3:3.5",
    "commonsHttpClient": "commons-httpclient:commons-httpclient:3.1",
    "commonsCompress":"org.apache.commons:commons-compress:1.10",
    "commonsPool": "org.apache.commons:commons-pool2:2.4.2",
    "datanucleusCore": "org.datanucleus:datanucleus-core:3.2.10",
    "datanucleusRdbms": "org.datanucleus:datanucleus-rdbms:3.2.9",
    "errorProne": "com.google.errorprone:error_prone_annotations:2.0.15",
    "eventhub": "com.microsoft.azure:azure-eventhubs:0.9.0",
    "guava": "com.google.guava:guava:21.0",
    "groovy": "org.codehaus.groovy:groovy:2.4.8",
    "gson": "com.google.code.gson:gson:2.6.2",
    "gsonJavatimeSerialisers": "com.fatboyindustrial.gson-javatime-serialisers:gson-javatime-serialisers:1.1.1",
    "findBugsAnnotations": "com.google.code.findbugs:jsr305:" + findBugsVersion,
    "hadoopCommon": "org.apache.hadoop:hadoop-common:" + hadoopVersion,
    "hadoopClientCore": "org.apache.hadoop:hadoop-mapreduce-client-core:" + hadoopVersion,
    "hadoopClientCommon": "org.apache.hadoop:hadoop-mapreduce-client-common:" + hadoopVersion,
    "hadoopHdfs": "org.apache.hadoop:hadoop-hdfs:" + hadoopVersion,
    "hadoopAuth": "org.apache.hadoop:hadoop-auth:" + hadoopVersion,
    "hadoopYarnApi": "org.apache.hadoop:hadoop-yarn-api:" + hadoopVersion,
    "hadoopYarnCommon": "org.apache.hadoop:hadoop-yarn-common:" + hadoopVersion,
    "hadoopYarnClient": "org.apache.hadoop:hadoop-yarn-client:" + hadoopVersion,
    "hadoopYarnMiniCluster": "org.apache.hadoop:hadoop-minicluster:" + hadoopVersion,
    "hadoopAnnotations": "org.apache.hadoop:hadoop-annotations:" + hadoopVersion,
    "hadoopAws": "org.apache.hadoop:hadoop-aws:2.6.0",
    "hdrHistogram": "org.hdrhistogram:HdrHistogram:2.1.11",
    "helix": "org.apache.helix:helix-core:1.1.0",
    "hikariCP": "com.zaxxer:HikariCP:3.2.0",
    "hiveCommon": "com.linkedin.hive:hive-common:" + hiveVersion,
    "hiveService": "com.linkedin.hive:hive-service:" + hiveVersion,
    "hiveJdbc": "com.linkedin.hive:hive-jdbc:" + hiveVersion,
    "hiveMetastore": "com.linkedin.hive:hive-metastore:" + hiveVersion,
    "hiveExec": "com.linkedin.hive:hive-exec:" + hiveVersion + ":core",
    "hiveSerDe": "com.linkedin.hive:hive-serde:" + hiveVersion,
    "hiveStorageApi": "org.apache.hive:hive-storage-api:2.4.0",
    "httpclient": "org.apache.httpcomponents:httpclient:4.5.2",
    "httpmime": "org.apache.httpcomponents:httpmime:4.5.2",
    "httpcore": "org.apache.httpcomponents:httpcore:4.4.11",
    "httpasyncclient": "org.apache.httpcomponents:httpasyncclient:4.1.3",
    "icebergHive": "org.apache.iceberg:iceberg-hive-runtime:" + icebergVersion,
    "icebergHiveMetastoreTest": "org.apache.iceberg:iceberg-hive-metastore:" + icebergVersion + ":tests",
    "jgit": "org.eclipse.jgit:org.eclipse.jgit:5.1.1.201809181055-r",
    "jmh": "org.openjdk.jmh:jmh-core:1.17.3",
    "jmhAnnotations": "org.openjdk.jmh:jmh-generator-annprocess:1.17.3",
    "jollyday": "de.jollyday:jollyday:0.4.9",
    "kafka08": "org.apache.kafka:kafka_2.11:" + kafka08Version,
    "kafka08Test": "org.apache.kafka:kafka_2.11:" + kafka08Version + ":test",
    "kafka08Client": "org.apache.kafka:kafka-clients:" + kafka08Version,
    "kafka09": "org.apache.kafka:kafka_2.11:" + kafka09Version,
    "kafka09Test": "org.apache.kafka:kafka_2.11:" + kafka09Version + ":test",
    "kafka09Client": "org.apache.kafka:kafka-clients:" + kafka09Version,
    "kafka1": "org.apache.kafka:kafka_2.11:" + kafka1Version,
    "kafka1Test": "org.apache.kafka:kafka_2.11:" + kafka1Version + ":test",
    "kafka1Client": "org.apache.kafka:kafka-clients:" + kafka1Version,
    "kafka1ClientTest": "org.apache.kafka:kafka-clients:" + kafka1Version + ":test",
    "confluentSchemaRegistryClient": "io.confluent:kafka-schema-registry-client:" + confluentVersion,
    "confluentAvroSerializer": "io.confluent:kafka-avro-serializer:" + confluentVersion,
    "confluentJsonSerializer": "io.confluent:kafka-json-serializer:" + confluentVersion,
    "zkClient": "com.101tec:zkclient:0.7",
    "quartz": "org.quartz-scheduler:quartz:2.2.3",
    "temporal-sdk": "io.temporal:temporal-sdk:1.18.1",
    "testng": "org.testng:testng:6.14.3",
    "junit": "junit:junit:4.13.2",
    "mockserver":"org.mock-server:mockserver-netty:3.10.4",
    "jacksonCore": "org.codehaus.jackson:jackson-core-asl:1.9.13",
    "jacksonMapperAsl": "org.codehaus.jackson:jackson-mapper-asl:1.9.13",
    "jacksonMapper": "com.fasterxml.jackson.core:jackson-databind:2.10.2",
    "jasypt": "org.jasypt:jasypt:1.9.2",
    "jodaTime": "joda-time:joda-time:2.9.3",
    "jgrapht": "org.jgrapht:jgrapht-core:0.9.2",
    "metricsCore": "io.dropwizard.metrics:metrics-core:" + dropwizardMetricsVersion,
    "metricsJvm": "io.dropwizard.metrics:metrics-jvm:" + dropwizardMetricsVersion,
    "metricsGraphite": "io.dropwizard.metrics:metrics-graphite:" + dropwizardMetricsVersion,
    "metricsJmx": "io.dropwizard.metrics:metrics-jmx:" + dropwizardMetricsVersion,
    "opentelemetryApi": "io.opentelemetry:opentelemetry-api:" + openTelemetryVersion,
    "opentelemetrySdk": "io.opentelemetry:opentelemetry-sdk:" + openTelemetryVersion,
    "opentelemetryExporterOtlp": "io.opentelemetry:opentelemetry-exporter-otlp:" + openTelemetryVersion,
    "opentelemetrySdkTesting": "io.opentelemetry:opentelemetry-sdk-testing:" + openTelemetryVersion,
    "micrometerCore": "io.micrometer:micrometer-core:" + micrometerVersion,
    "micrometerRegistry": "io.micrometer:micrometer-registry-otlp:" + micrometerVersion,
    "jsch": "com.jcraft:jsch:0.1.54",
    "jdo2": "javax.jdo:jdo2-api:2.1",
    "azkaban": "com.linkedin.azkaban:azkaban:2.5.0",
    "commonsVfs": "org.apache.commons:commons-vfs2:2.0",
    "mysqlConnector": "mysql:mysql-connector-java:8.0.24",
    "javaxInject": "javax.inject:javax.inject:1",
    "guice": "com.google.inject:guice:4.2.2",
    "guiceMultibindings": "com.google.inject.extensions:guice-multibindings:4.0",
    "guiceServlet": "com.google.inject.extensions:guice-servlet:4.0",
    "derby": "org.apache.derby:derby:10.12.1.1",
    // NOTE: To use features from mockito-inline, follow the wiki as opposed to changing this
    // dependency directly to mockito-inline
    // https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2#unmockable
    "mockito": "org.mockito:mockito-core:4.11.0",
    "mockitoInline": "org.mockito:mockito-inline:4.11.0",
    "salesforceWsc": "com.force.api:force-wsc:" + salesforceVersion,
    "salesforcePartner": "com.force.api:force-partner-api:" + salesforceVersion,
    "scala": "org.scala-lang:scala-library:2.11.8",
    "influxdbJava": "org.influxdb:influxdb-java:2.1",
    "kryo": "com.esotericsoftware.kryo:kryo:2.22",
    "libthrift":"org.apache.thrift:libthrift:0.9.3",
    "lombok":"org.projectlombok:lombok:1.18.16",
    "mockRunnerJdbc":"com.mockrunner:mockrunner-jdbc:1.0.8",
    "xerces":"xerces:xercesImpl:2.11.0",
    "typesafeConfig": "com.typesafe:config:1.4.1",
    "byteman": "org.jboss.byteman:byteman:" + bytemanVersion,
    "bytemanBmunit": "org.jboss.byteman:byteman-bmunit:" + bytemanVersion,
    "bcpgJdk15on": "org.bouncycastle:bcpg-jdk15on:1.52",
    "bcprovJdk15on": "org.bouncycastle:bcprov-jdk15on:1.52",
    "calciteCore": "org.apache.calcite:calcite-core:1.16.0",
    "calciteAvatica": "org.apache.calcite:calcite-avatica:1.13.0",
    "jhyde": "net.hydromatic:aggdesigner-algorithm:6.0",
    "curatorFramework": "org.apache.curator:curator-framework:2.12.0",
    "curatorRecipes": "org.apache.curator:curator-recipes:2.12.0",
    "curatorClient": "org.apache.curator:curator-client:2.12.0",
    "curatorTest": "org.apache.curator:curator-test:2.12.0",
    "hamcrest": "org.hamcrest:hamcrest-all:1.3",
    "joptSimple": "net.sf.jopt-simple:jopt-simple:4.9",
    "protobuf": "com.google.protobuf:protobuf-java:3.6.1",
    "pegasus" : [
        "data" : "com.linkedin.pegasus:data:" + pegasusVersion,
        "generator" : "com.linkedin.pegasus:generator:" + pegasusVersion,
        "restliClient" : "com.linkedin.pegasus:restli-client:" + pegasusVersion,
        "restliServer" : "com.linkedin.pegasus:restli-server:" + pegasusVersion,
        "restliTools" : "com.linkedin.pegasus:restli-tools:" + pegasusVersion,
        "pegasusCommon" : "com.linkedin.pegasus:pegasus-common:" + pegasusVersion,
        "restliCommon" : "com.linkedin.pegasus:restli-common:" + pegasusVersion,
        "r2" : "com.linkedin.pegasus:r2:" + pegasusVersion,
        "d2" : "com.linkedin.pegasus:d2:" + pegasusVersion,
        "r2Netty" : "com.linkedin.pegasus:r2-netty:" + pegasusVersion,
        "restliNettyStandalone" : "com.linkedin.pegasus:restli-netty-standalone:" + pegasusVersion,
        "restliGuiceBridge": "com.linkedin.pegasus:restli-guice-bridge:" + pegasusVersion
    ],
    "jetty": [
        "org.eclipse.jetty:jetty-server:9.2.14.v20151106",
        "org.eclipse.jetty:jetty-servlet:9.2.14.v20151106"
    ],
    "servlet-api": "javax.servlet:servlet-api:3.1.0",
    "guavaretrying": "com.github.rholder:guava-retrying:2.0.0",
    "jsonAssert": "org.skyscreamer:jsonassert:1.3.0",
    "reflections" : "org.reflections:reflections:0.9.10",
    "embeddedProcess": "de.flapdoodle.embed:de.flapdoodle.embed.process:1.50.2",
    "flyway": "org.flywaydb:flyway-core:7.9.2",
    "oltu": "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2",
    "googleAnalytics": "com.google.apis:google-api-services-analytics:v3-rev134-1.22.0",
    "googleDrive": "com.google.apis:google-api-services-drive:v3-rev42-1.22.0",
    "googleWebmasters": "com.google.apis:google-api-services-webmasters:v3-rev17-1.22.0",
    "googleHttpClient": "com.google.http-client:google-http-client:" + googleVersion,
    "googleHttpClientGson": "com.google.http-client:google-http-client-gson:" + googleVersion,
    "googleOauthClient": "com.google.oauth-client:google-oauth-client:" + googleVersion,
    "googleApiClient": "com.google.api-client:google-api-client:" + googleVersion,
    "opencsv": "com.opencsv:opencsv:3.8",
    "grok": "io.thekraken:grok:0.1.5",
    "hadoopAdl" : "org.apache.hadoop:hadoop-azure-datalake:3.2.3",
    /**
     * Avoiding conflicts with Hive 1.x versions existed in the classpath
     */
    "orcMapreduce":"org.apache.orc:orc-mapreduce:1.7.6:nohive",
    "orcCore": "org.apache.orc:orc-core:1.7.6:nohive",
    "orcTools":"org.apache.orc:orc-tools:1.7.6",
    'parquet': 'org.apache.parquet:parquet-hadoop:1.11.0',
    'parquetAvro': 'org.apache.parquet:parquet-avro:1.11.0',
    'parquetProto': 'org.apache.parquet:parquet-protobuf:1.11.0',
    'parquetHadoop': 'org.apache.parquet:parquet-hadoop-bundle:1.11.0',
    'powerMockApi' : 'org.powermock:powermock-api-mockito2:2.0.9',
    'powerMockModule' : 'org.powermock:powermock-module-junit4:2.0.9',
    'reactivex': 'io.reactivex.rxjava2:rxjava:2.1.0',
    "slf4j": [
        "org.slf4j:slf4j-api:" + slf4jVersion,
        "org.slf4j:log4j-over-slf4j:" + slf4jVersion,
        "org.slf4j:jcl-over-slf4j:" + slf4jVersion
    ],
    "log4j": [
        "log4j:log4j:" + log4jVersion,
        "log4j:apache-log4j-extras:" + log4jVersion
    ],
    "slf4jToLog4j":[
        "org.slf4j:slf4j-log4j12:" + slf4jVersion
    ],
    "postgresConnector": "org.postgresql:postgresql:42.1.4",
    "tdigest": "com.tdunning:t-digest:3.3",
    "testContainers": "org.testcontainers:testcontainers:1.17.3",
    "testContainersMysql": "org.testcontainers:mysql:1.17.3",
    "xz": "org.tukaani:xz:1.8"
]

if (!isDefaultEnvironment)
{
  ext.externalDependency.each { overrideDepKey, overrideDepValue ->
    if (externalDependency[overrideDepKey] != null)
    {
      externalDependency[overrideDepKey] = overrideDepValue
    }
  }
}
