/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * license agreements; and to You under the Apache License, version 2.0:
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * This file is part of the Apache Pekko project, which was derived from Akka.
 */

import sbt._
import Common.isScala3
import Keys._
import com.github.sbt.junit.jupiter.sbt.Import.JupiterKeys

object Dependencies {

  val CronBuild = sys.env.get("GITHUB_EVENT_NAME").contains("schedule")

  val Scala213 = "2.13.18" // update even in link-validator.conf
  val Scala3 = "3.3.8"
  val Scala3Next = "3.8.4"
  val PublishedScalaVersions = Seq(Scala213, Scala3)

  val PekkoVersion = PekkoCoreDependency.version
  val PekkoBinaryVersion = PekkoCoreDependency.default.link

  val InfluxDBJavaVersion = "2.25"

  val AvroVersion = "1.12.1"

  val AwsSdk2Version = "2.51.2"

  val NettyVersion = "4.2.17.Final"

  // Sync with plugins.sbt
  val PekkoGrpcBinaryVersion = "1.1"
  val PekkoHttpVersion = PekkoHttpDependency.version
  val PekkoStreamsCirceVersion = "2.0.0-M1"
  val PekkoHttpBinaryVersion = PekkoHttpDependency.default.link
  val ScalaTestVersion = "3.2.20"
  val TestContainersScalaTestVersion = "0.44.1"
  val mockitoVersion = "5.23.0" // check even https://github.com/scalatest/scalatestplus-mockito/releases
  val protobufJavaVersion = "4.35.1"
  val hoverflyVersion = "0.20.2"
  val scalaCheckVersion = "1.19.0"
  val HadoopVersion = "3.4.3"

  // Legacy versions support Slf4J v1 for compatibility with older libs
  val Slf4jVersion = "2.0.18"
  val Slf4jLegacyVersion = "1.7.36"
  val LogbackVersion = "1.6.1"
  val LogbackLegacyVersion = "1.2.13"

  /**
   * Calculates the scalatest version in a format that is used for `org.scalatestplus` scalacheck artifacts
   *
   * @see
   * https://www.scalatest.org/user_guide/property_based_testing
   */
  private def scalaTestPlusScalaCheckVersion(version: String) =
    version.split('.').take(2).mkString("-")

  val scalaTestScalaCheckArtifact = s"scalacheck-${scalaTestPlusScalaCheckVersion(scalaCheckVersion)}"
  val scalaTestScalaCheckVersion = s"$ScalaTestVersion.0"
  val scalaTestMockitoVersion = s"$ScalaTestVersion.0"

  val CouchbaseVersion = "2.7.23"
  val Couchbase3Version = "3.6.4"
  val CouchbaseVersionForDocs = "2.7"

  val GoogleAuthVersion = "1.50.0"
  val JwtScalaVersion = "11.0.4"
  val Log4jVersion = "2.26.1"

  // Releases https://github.com/FasterXML/jackson-databind/releases
  // CVE issues https://github.com/FasterXML/jackson-databind/issues?utf8=%E2%9C%93&q=+label%3ACVE
  // This should align with the Jackson minor version used in Pekko 1.1.x
  // https://github.com/apache/pekko/blob/main/project/Dependencies.scala
  val JacksonVersion = "2.22.1"
  val JacksonDatabindDependencies = Seq(
    "com.fasterxml.jackson.core" % "jackson-core" % JacksonVersion,
    "com.fasterxml.jackson.core" % "jackson-databind" % JacksonVersion)

  private val wireMockDependencies = Seq(
    "org.wiremock" % "wiremock" % "3.13.2" % Test)

  val CommonSettings = Seq(
    // These libraries are added to all modules via the `Common` AutoPlugin
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-stream" % PekkoVersion))

  val testkit = Seq(
    libraryDependencies := Seq(
      "org.apache.pekko" %% "pekko-stream" % PekkoVersion,
      "org.apache.pekko" %% "pekko-stream-testkit" % PekkoVersion,
      "org.apache.pekko" %% "pekko-slf4j" % PekkoVersion,
      "org.slf4j" % "slf4j-api" % Slf4jVersion,
      "ch.qos.logback" % "logback-classic" % LogbackVersion,
      "org.scalatest" %% "scalatest" % ScalaTestVersion,
      "com.dimafeng" %% "testcontainers-scala-scalatest" % TestContainersScalaTestVersion,
      "com.github.sbt" % "junit-interface" % "0.13.3",
      "junit" % "junit" % "4.13.2",
      "org.junit.jupiter" % "junit-jupiter-api" % JupiterKeys.junitJupiterVersion.value,
      "org.junit.jupiter" % "junit-jupiter-params" % JupiterKeys.junitJupiterVersion.value,
      "com.github.sbt.junit" % "jupiter-interface" % JupiterKeys.jupiterVersion.value))

  val Mockito = Seq(
    "org.mockito" % "mockito-core" % mockitoVersion % Test,
    // https://github.com/scalatest/scalatestplus-mockito/releases
    "org.scalatestplus" %% "mockito-5-23" % scalaTestMockitoVersion % Test)

  val Amqp = Seq(
    libraryDependencies ++= Seq(
      "com.rabbitmq" % "amqp-client" % "5.34.0",
      "org.junit.jupiter" % "junit-jupiter-params" % JupiterKeys.junitJupiterVersion.value % Test,
      "org.scalatestplus" %% scalaTestScalaCheckArtifact % scalaTestScalaCheckVersion % Test) ++ Mockito)

  val AwsSpiPekkoHttp = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "software.amazon.awssdk" % "http-client-spi" % AwsSdk2Version,
      ("software.amazon.awssdk" % "dynamodb" % AwsSdk2Version % Test).excludeAll(
        ExclusionRule("software.amazon.awssdk", "netty-nio-client")),
      ("software.amazon.awssdk" % "kinesis" % AwsSdk2Version % Test).excludeAll(
        ExclusionRule("software.amazon.awssdk", "netty-nio-client")),
      ("software.amazon.awssdk" % "sns" % AwsSdk2Version % Test).excludeAll(
        ExclusionRule("software.amazon.awssdk", "netty-nio-client")),
      ("software.amazon.awssdk" % "sqs" % AwsSdk2Version % Test).excludeAll(
        ExclusionRule("software.amazon.awssdk", "netty-nio-client")),
      ("software.amazon.awssdk" % "s3" % AwsSdk2Version % Test).excludeAll(
        ExclusionRule("software.amazon.awssdk", "netty-nio-client")),
      ("software.amazon.awssdk" % "http-client-tests" % AwsSdk2Version % Test).excludeAll(
        ExclusionRule("software.amazon.awssdk", "netty-nio-client")),
      "com.dimafeng" %% "testcontainers-scala" % TestContainersScalaTestVersion % Test,
      "com.github.sbt.junit" % "jupiter-interface" % JupiterKeys.jupiterVersion.value % Test,
      "org.junit.vintage" % "junit-vintage-engine" % JupiterKeys.junitVintageVersion.value % Test,
      "org.testcontainers" % "testcontainers-junit-jupiter" % "2.0.5" % Test,
      "org.scalatest" %% "scalatest" % ScalaTestVersion % Test,
      "ch.qos.logback" % "logback-classic" % LogbackVersion % Test))

  val AwsLambda = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      ("software.amazon.awssdk" % "lambda" % AwsSdk2Version).excludeAll(
        ExclusionRule("software.amazon.awssdk", "apache-client"),
        ExclusionRule("software.amazon.awssdk", "netty-nio-client"))) ++ Mockito)

  val AzureStorageQueue = Seq(
    libraryDependencies ++= Seq(
      "com.microsoft.azure" % "azure-storage" % "8.6.6"))

  val CassandraVersionInDocs = "4.0"
  val CassandraDriverVersion = "4.19.3"
  val CassandraDriverVersionInDocs = "4.17"

  val Cassandra = Seq(
    libraryDependencies ++= JacksonDatabindDependencies ++ Seq(
      "org.apache.cassandra" % "java-driver-core" % CassandraDriverVersion,
      "io.netty" % "netty-handler" % NettyVersion,
      "org.apache.pekko" %% "pekko-discovery" % PekkoVersion % Provided))

  val Couchbase = Seq(
    libraryDependencies ++= Seq(
      "com.couchbase.client" % "java-client" % CouchbaseVersion,
      "io.reactivex" % "rxjava-reactive-streams" % "1.2.1",
      "org.apache.pekko" %% "pekko-discovery" % PekkoVersion % Provided,
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion % Test,
      "com.fasterxml.jackson.core" % "jackson-databind" % JacksonVersion % Test,
      "com.fasterxml.jackson.module" %% "jackson-module-scala" % JacksonVersion % Test))

  val Couchbase3 = Seq(
    libraryDependencies ++= Seq(
      "com.couchbase.client" % "java-client" % Couchbase3Version,
      "org.apache.pekko" %% "pekko-discovery" % PekkoVersion % Provided,
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion % Test,
      "com.fasterxml.jackson.core" % "jackson-databind" % JacksonVersion % Test,
      "com.fasterxml.jackson.module" %% "jackson-module-scala" % JacksonVersion % Test))

  val `Doc-examples` = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-slf4j" % PekkoVersion,
      "org.apache.pekko" %% "pekko-stream-testkit" % PekkoVersion % Test,
      "org.apache.pekko" %% "pekko-connectors-kafka" % "2.0.0-M1" % Test,
      "junit" % "junit" % "4.13.2" % Test,
      "org.junit.jupiter" % "junit-jupiter-api" % JupiterKeys.junitJupiterVersion.value % Test,
      "org.scalatest" %% "scalatest" % ScalaTestVersion % Test))

  val DynamoDB = Seq(
    libraryDependencies ++= Seq(
      ("software.amazon.awssdk" % "dynamodb" % AwsSdk2Version).excludeAll(
        ExclusionRule("software.amazon.awssdk", "apache-client"),
        ExclusionRule("software.amazon.awssdk", "netty-nio-client")),
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion))

  val Elasticsearch = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "org.apache.pekko" %% "pekko-http-spray-json" % PekkoHttpVersion,
      "org.slf4j" % "jcl-over-slf4j" % Slf4jVersion % Test) ++ JacksonDatabindDependencies)

  val File = Seq(
    libraryDependencies ++= Seq(
      "com.google.jimfs" % "jimfs" % "1.3.1" % Test))

  val avro4sVersion: Def.Initialize[String] = Def.setting {
    if (Common.isScala3.value) "5.0.15" else "4.1.2"
  }

  val AvroParquet = Seq(
    libraryDependencies ++= Seq(
      "org.apache.parquet" % "parquet-avro" % "1.17.1",
      "org.apache.avro" % "avro" % AvroVersion,
      ("org.apache.hadoop" % "hadoop-client" % HadoopVersion % Test)
        .exclude("ch.qos.reload4j", "reload4j")
        .exclude("org.slf4j", "slf4j-reload4j"),
      ("org.apache.hadoop" % "hadoop-common" % HadoopVersion % Test)
        .exclude("ch.qos.reload4j", "reload4j")
        .exclude("org.slf4j", "slf4j-reload4j"),
      "com.sksamuel.avro4s" %% "avro4s-core" % avro4sVersion.value % Test,
      "org.scalacheck" %% "scalacheck" % scalaCheckVersion % Test,
      "org.specs2" %% "specs2-core" % "4.23.0" % Test,
      "org.slf4j" % "slf4j-api" % Slf4jVersion % Test,
      "org.slf4j" % "log4j-over-slf4j" % Slf4jVersion % Test))

  val Ftp = Seq(
    libraryDependencies ++= Seq(
      "commons-net" % "commons-net" % "3.13.0",
      "com.hierynomus" % "sshj" % "0.40.0",
      "org.slf4j" % "slf4j-api" % Slf4jVersion % Test,
      "ch.qos.logback" % "logback-classic" % LogbackVersion % Test) ++ Mockito)

  val GeodeVersion = "2.0.2"
  val GeodeVersionForDocs = "115"

  val Geode = Seq(
    libraryDependencies ++= {
      Seq("geode-core", "geode-cq")
        .map("org.apache.geode" % _ % GeodeVersion) ++
      Seq(
        "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % JacksonVersion,
        "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % JacksonVersion
      ) ++ JacksonDatabindDependencies ++
      (if (isScala3.value)
         Seq.empty // Equivalent and relevant shapeless functionality has been mainlined into Scala 3 language/stdlib
       else Seq(
         "com.chuusai" %% "shapeless" % "2.3.13"))
    })

  val GoogleCommon = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "org.apache.pekko" %% "pekko-http-spray-json" % PekkoHttpVersion,
      "com.github.jwt-scala" %% "jwt-json-common" % JwtScalaVersion,
      "com.google.auth" % "google-auth-library-credentials" % GoogleAuthVersion,
      "com.google.auth" % "google-auth-library-oauth2-http" % GoogleAuthVersion,
      "io.specto" % "hoverfly-java" % hoverflyVersion % Test) ++ Mockito)

  val GoogleBigQuery = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "org.apache.pekko" %% "pekko-http-jackson" % PekkoHttpVersion % Provided,
      "org.apache.pekko" %% "pekko-http-spray-json" % PekkoHttpVersion,
      "io.spray" %% "spray-json" % "1.3.6",
      "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % JacksonVersion % Test,
      "io.specto" % "hoverfly-java" % hoverflyVersion % Test) ++ JacksonDatabindDependencies ++ Mockito)

  val ArrowVersion = "19.0.0"
  val GoogleBigQueryStorage = Seq(
    // see Pekko gRPC version in plugins.sbt
    libraryDependencies ++= Seq(
      // https://github.com/googleapis/java-bigquerystorage/tree/master/proto-google-cloud-bigquerystorage-v1
      "com.google.api.grpc" % "proto-google-cloud-bigquerystorage-v1" % "3.31.0" % "protobuf-src",
      "org.apache.avro" % "avro" % AvroVersion % "provided",
      "org.apache.arrow" % "arrow-vector" % ArrowVersion % "provided",
      "io.grpc" % "grpc-auth" % org.apache.pekko.grpc.gen.BuildInfo.grpcVersion,
      "com.google.protobuf" % "protobuf-java" % protobufJavaVersion % Runtime,
      "org.apache.pekko" %% "pekko-discovery" % PekkoVersion,
      "org.apache.pekko" %% "pekko-http-spray-json" % PekkoHttpVersion,
      "org.apache.pekko" %% "pekko-http-core" % PekkoHttpVersion,
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "org.apache.pekko" %% "pekko-parsing" % PekkoHttpVersion,
      "org.apache.arrow" % "arrow-memory-netty" % ArrowVersion % Test,
      "org.slf4j" % "slf4j-api" % Slf4jVersion % Test,
      "ch.qos.logback" % "logback-classic" % LogbackVersion % Test) ++ Mockito)

  val GooglePubSub = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "org.apache.pekko" %% "pekko-http-spray-json" % PekkoHttpVersion) ++
    Mockito ++ wireMockDependencies)

  val GooglePubSubGrpc = Seq(
    // see Pekko gRPC version in plugins.sbt
    libraryDependencies ++= Seq(
      // https://github.com/googleapis/java-pubsub/tree/master/proto-google-cloud-pubsub-v1/
      "com.google.cloud" % "google-cloud-pubsub" % "1.153.0" % "protobuf-src",
      "io.grpc" % "grpc-auth" % org.apache.pekko.grpc.gen.BuildInfo.grpcVersion,
      "com.google.auth" % "google-auth-library-oauth2-http" % GoogleAuthVersion,
      "com.google.protobuf" % "protobuf-java" % protobufJavaVersion % Runtime,
      // pull in Pekko Discovery for our Pekko version
      "org.apache.pekko" %% "pekko-discovery" % PekkoVersion))

  val GoogleFcm = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "org.apache.pekko" %% "pekko-http-spray-json" % PekkoHttpVersion) ++ Mockito)

  val GoogleStorage = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "org.apache.pekko" %% "pekko-http-spray-json" % PekkoHttpVersion,
      "io.specto" % "hoverfly-java" % hoverflyVersion % Test) ++ Mockito)

  val HBase = {
    val hbaseVersion = "1.4.14"
    Seq(
      libraryDependencies ++= Seq(
        ("org.apache.hbase" % "hbase-shaded-client" % hbaseVersion)
          .exclude("log4j", "log4j")
          .exclude("org.slf4j", "slf4j-log4j12"),
        ("org.apache.hbase" % "hbase-common" % hbaseVersion)
          .exclude("log4j", "log4j")
          .exclude("org.slf4j", "slf4j-log4j12"),
        ("org.apache.hadoop" % "hadoop-common" % HadoopVersion)
          .exclude("ch.qos.reload4j", "reload4j")
          .exclude("org.slf4j", "slf4j-reload4j"),
        ("org.apache.hadoop" % "hadoop-mapreduce-client-core" % HadoopVersion)
          .exclude("ch.qos.reload4j", "reload4j")
          .exclude("org.slf4j", "slf4j-reload4j"),
        "org.slf4j" % "log4j-over-slf4j" % Slf4jVersion % Test))
  }

  val Hdfs = Seq(
    libraryDependencies ++= Seq(
      ("org.apache.hadoop" % "hadoop-client" % HadoopVersion)
        .exclude("ch.qos.reload4j", "reload4j")
        .exclude("org.slf4j", "slf4j-reload4j"),
      "org.typelevel" %% "cats-core" % "2.13.0",
      ("org.apache.hadoop" % "hadoop-hdfs" % HadoopVersion % Test)
        .exclude("ch.qos.reload4j", "reload4j")
        .exclude("org.slf4j", "slf4j-reload4j"),
      ("org.apache.hadoop" % "hadoop-common" % HadoopVersion % Test)
        .exclude("ch.qos.reload4j", "reload4j")
        .exclude("org.slf4j", "slf4j-reload4j"),
      ("org.apache.hadoop" % "hadoop-minicluster" % HadoopVersion % Test)
        .exclude("ch.qos.reload4j", "reload4j")
        .exclude("org.slf4j", "slf4j-reload4j"),
      "org.slf4j" % "log4j-over-slf4j" % Slf4jVersion % Test) ++ Mockito)

  val HuaweiPushKit = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "org.apache.pekko" %% "pekko-http-spray-json" % PekkoHttpVersion,
      "com.github.jwt-scala" %% "jwt-json-common" % JwtScalaVersion) ++ Mockito)

  val InfluxDB = Seq(
    libraryDependencies ++= Seq(
      "org.influxdb" % "influxdb-java" % InfluxDBJavaVersion))

  val IronMq = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "org.mdedetrich" %% "pekko-stream-circe" % PekkoStreamsCirceVersion,
      "org.mdedetrich" %% "pekko-http-circe" % PekkoStreamsCirceVersion,
      "io.circe" %% "circe-jawn" % "0.14.16"))

  val JakartaMs = {
    val artemisVersion = "2.55.0"
    Seq(
      libraryDependencies ++= Seq(
        "jakarta.jms" % "jakarta.jms-api" % "3.1.0" % Provided,
        "com.ibm.mq" % "com.ibm.mq.jakarta.client" % "10.0.0.0" % Test,
        "org.apache.artemis" % "artemis-server" % artemisVersion % Test,
        "org.apache.artemis" % "artemis-jakarta-client" % artemisVersion % Test,
        "org.apache.artemis" % "artemis-junit" % artemisVersion % Test,
        "com.github.pjfanning" % "jakartamswrapper" % "0.1.0" % Test) ++ Mockito)
  }

  val Jms = Seq(
    libraryDependencies ++= Seq(
      "javax.jms" % "javax.jms-api" % "2.0.1" % Provided,
      "com.ibm.mq" % "com.ibm.mq.allclient" % "10.0.0.0" % Test,
      "org.apache.activemq" % "activemq-broker" % "5.19.9" % Test,
      "org.apache.activemq" % "activemq-client" % "5.19.9" % Test,
      "io.github.sullis" %% "jms-testkit" % "1.0.4" % Test,
      "com.github.pjfanning" % "jmswrapper" % "0.1.0" % Test) ++ Mockito)

  val JsonStreaming = Seq(
    libraryDependencies ++= Seq(
      "com.github.jsurfer" % "jsurfer-jackson" % "1.6.5") ++ JacksonDatabindDependencies)

  val Kinesis = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "software.amazon.awssdk" % "kinesis" % AwsSdk2Version,
      "software.amazon.awssdk" % "firehose" % AwsSdk2Version,
      "software.amazon.kinesis" % "amazon-kinesis-client" % "3.5.1").map(
      _.excludeAll(
        ExclusionRule("software.amazon.awssdk", "apache-client"),
        ExclusionRule("software.amazon.awssdk", "netty-nio-client"))) ++ Seq(
      "org.slf4j" % "slf4j-api" % Slf4jVersion % Test,
      "ch.qos.logback" % "logback-classic" % LogbackVersion % Test) ++ Mockito)

  val KuduVersion = "1.18.1"
  val Kudu = Seq(
    libraryDependencies ++= Seq(
      "org.apache.kudu" % "kudu-client" % KuduVersion,
      "com.stumbleupon" % "async" % "1.4.1",
      "org.apache.logging.log4j" % "log4j-to-slf4j" % Log4jVersion % Test))

  val MongoDb = Seq(
    libraryDependencies ++= Seq(
      "org.mongodb.scala" %% "mongo-scala-driver" % "5.9.1"))

  val Mqtt = Seq(
    libraryDependencies ++= Seq(
      "org.eclipse.paho" % "org.eclipse.paho.client.mqttv3" % "1.2.5"))

  val MqttV5 = Seq(
    libraryDependencies ++= Seq(
      "org.eclipse.paho" % "org.eclipse.paho.mqttv5.client" % "1.2.5"))

  val MqttStreaming = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-actor-typed" % PekkoVersion,
      "org.apache.pekko" %% "pekko-actor-testkit-typed" % PekkoVersion % Test,
      "org.apache.pekko" %% "pekko-stream-typed" % PekkoVersion,
      "org.apache.pekko" %% "pekko-stream-testkit" % PekkoVersion % Test))

  val OrientDB = Seq(
    libraryDependencies ++= JacksonDatabindDependencies ++ Seq(
      ("com.orientechnologies" % "orientdb-graphdb" % "3.2.55")
        .exclude("com.tinkerpop.blueprints", "blueprints-core"),
      "com.orientechnologies" % "orientdb-object" % "3.2.55"))

  val PravegaVersion = "0.13.0"
  val PravegaVersionForDocs = "latest"

  val Pravega = {
    Seq(
      libraryDependencies ++= Seq(
        "io.pravega" % "pravega-client" % PravegaVersion,
        "org.slf4j" % "slf4j-api" % Slf4jVersion % Test,
        "org.slf4j" % "log4j-over-slf4j" % Slf4jVersion % Test))
  }

  val Reference = Seq(
    // connector specific library dependencies and resolver settings
    libraryDependencies ++= Seq(
    ))

  val S3 = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "org.apache.pekko" %% "pekko-http-xml" % PekkoHttpVersion,
      "software.amazon.awssdk" % "auth" % AwsSdk2Version,
      // in-memory filesystem for file related tests
      "com.google.jimfs" % "jimfs" % "1.3.1" % Test,
      "org.apache.commons" % "commons-lang3" % "3.20.0" % Test,
      "org.scalacheck" %% "scalacheck" % scalaCheckVersion % Test,
      "org.scalatestplus" %% scalaTestScalaCheckArtifact % scalaTestScalaCheckVersion % Test) ++
    wireMockDependencies)

  val SpringWeb = {
    val SpringVersion = "7.0.8"
    val SpringBootVersion = "4.1.0"
    Seq(
      libraryDependencies ++= Seq(
        "org.springframework" % "spring-core" % SpringVersion,
        "org.springframework" % "spring-context" % SpringVersion,
        "org.springframework.boot" % "spring-boot-autoconfigure" % SpringBootVersion, // TODO should this be provided?
        "org.springframework.boot" % "spring-boot-configuration-processor" % SpringBootVersion % Optional,
        // for examples
        "org.springframework.boot" % "spring-boot-starter-web" % SpringBootVersion % Test,
        "jakarta.annotation" % "jakarta.annotation-api" % "3.0.0" % Test))
  }

  val SlickVersion = "3.6.1"
  val Slick = Seq(
    // Transitive dependency `scala-reflect` to avoid `NoClassDefFoundError`.
    // See: https://github.com/slick/slick/issues/2933
    libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
      case Some((2, _)) => Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value)
      case _            => Nil
    }),
    libraryDependencies ++= Seq(
      "com.typesafe.slick" %% "slick" % SlickVersion,
      "com.typesafe.slick" %% "slick-hikaricp" % SlickVersion,
      "ch.qos.logback" % "logback-classic" % LogbackVersion % Test,
      "com.h2database" % "h2" % "2.4.240" % Test))

  val Eventbridge = Seq(
    libraryDependencies ++= Seq(
      ("software.amazon.awssdk" % "eventbridge" % AwsSdk2Version).excludeAll(
        ExclusionRule("software.amazon.awssdk", "apache-client"),
        ExclusionRule("software.amazon.awssdk", "netty-nio-client")),
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion) ++ Mockito)

  val Sns = Seq(
    libraryDependencies ++= Seq(
      ("software.amazon.awssdk" % "sns" % AwsSdk2Version).excludeAll(
        ExclusionRule("software.amazon.awssdk", "apache-client"),
        ExclusionRule("software.amazon.awssdk", "netty-nio-client")),
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion) ++ Mockito)

  val SolrjVersion = "9.10.1"
  val SolrVersionForDocs = "9_10"

  val Solr = Seq(
    libraryDependencies ++= Seq(
      "org.apache.solr" % "solr-solrj" % SolrjVersion,
      ("org.apache.solr" % "solr-test-framework" % SolrjVersion % Test).exclude("org.apache.logging.log4j",
        "log4j-slf4j-impl"),
      "org.slf4j" % "log4j-over-slf4j" % Slf4jLegacyVersion % Test),
    dependencyOverrides ++= Seq(
      "org.slf4j" % "slf4j-api" % Slf4jLegacyVersion,
      "ch.qos.logback" % "logback-classic" % LogbackLegacyVersion))

  val Sqs = Seq(
    libraryDependencies ++= Seq(
      ("software.amazon.awssdk" % "sqs" % AwsSdk2Version).excludeAll(
        ExclusionRule("software.amazon.awssdk", "apache-client"),
        ExclusionRule("software.amazon.awssdk", "netty-nio-client")),
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "org.mockito" % "mockito-core" % mockitoVersion % Test) ++ Mockito)

  val Sse = Seq(
    libraryDependencies ++= Seq(
      "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion,
      "org.apache.pekko" %% "pekko-http-testkit" % PekkoHttpVersion % Test))

  val UnixDomainSocket = Seq(
    libraryDependencies ++= Seq(
      "com.github.jnr" % "jffi" % "1.4.0", // classifier "complete", // Is the classifier needed anymore?
      "com.github.jnr" % "jnr-unixsocket" % "0.39.2"))

  val Xml = Seq(
    libraryDependencies ++= Seq(
      "com.fasterxml" % "aalto-xml" % "1.4.0"))

}
