<commit_before>/*
 * Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
 */
import sbt._
import Keys._

import buildinfo.BuildInfo

object Dependencies {

  val akkaVersion: String = sys.props.getOrElse("akka.version", "2.5.19")
  val akkaHttpVersion: String = sys.props.getOrElse("akka.http.version", "10.1.6")
  val akkaHttpVersion_2_13 = "10.1.3" // akka-http dropped support for Scala 2.13: https://github.com/akka/akka-http/issues/2166

  val sslConfig = "com.typesafe" %% "ssl-config-core" % "0.3.7"

  val playJsonVersion = "2.7.0"

  val logback = "ch.qos.logback" % "logback-classic" % "1.2.3"

  val specs2Version = "4.3.6"
  val specs2Deps = Seq(
    "specs2-core",
    "specs2-junit",
    "specs2-mock"
  ).map("org.specs2" %% _ % specs2Version)

  val specsMatcherExtra = "org.specs2" %% "specs2-matcher-extra" % specs2Version

  val scalacheckDependencies = Seq(
    "org.specs2"     %% "specs2-scalacheck" % specs2Version % Test,
    "org.scalacheck" %% "scalacheck"        % "1.14.0"     % Test
  )

  // We need to use an older version of specs2 for sbt
  // because we need Scala 2.10 support (sbt 0.13).
  val specs2VersionForSbt = "3.10.0"
  val specs2DepsForSbt = specs2Deps.map(_.withRevision(specs2VersionForSbt))
  val specsMatcherExtraForSbt = specsMatcherExtra.withRevision(specs2VersionForSbt)

  val jacksonVersion = "2.9.8"
  val jacksons = Seq(
    "com.fasterxml.jackson.core" % "jackson-core",
    "com.fasterxml.jackson.core" % "jackson-annotations",
    "com.fasterxml.jackson.core" % "jackson-databind",
    "com.fasterxml.jackson.datatype" % "jackson-datatype-jdk8",
    "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310"
  ).map(_ % jacksonVersion)

  val playJson = "com.typesafe.play" %% "play-json" % playJsonVersion

  val slf4jVersion = "1.7.25"
  val slf4j = Seq("slf4j-api", "jul-to-slf4j", "jcl-over-slf4j").map("org.slf4j" % _ % slf4jVersion)
  val slf4jSimple = "org.slf4j" % "slf4j-simple" % slf4jVersion

  val guava = "com.google.guava" % "guava" % "27.0-jre"
  val findBugs = "com.google.code.findbugs" % "jsr305" % "3.0.2" // Needed by guava
  val mockitoAll = "org.mockito" % "mockito-core" % "2.23.4"

  val h2database = "com.h2database" % "h2" % "1.4.197"
  val derbyDatabase = "org.apache.derby" % "derby" % "10.13.1.1"

  val acolyteVersion = "1.0.49"
  val acolyte = "org.eu.acolyte" % "jdbc-driver" % acolyteVersion

  val jettyAlpnAgent = "org.mortbay.jetty.alpn" % "jetty-alpn-agent" % "2.0.9"

  val jjwt = "io.jsonwebtoken" % "jjwt" % "0.9.1"
  // currently jjwt needs the JAXB Api package in JDK 9+
  // since it actually uses javax/xml/bind/DatatypeConverter
  // See: https://github.com/jwtk/jjwt/issues/317
  val jaxbApi = "javax.xml.bind" % "jaxb-api" % "2.3.1"

  val jdbcDeps = Seq(
    "com.zaxxer" % "HikariCP" % "3.3.0",
    "com.googlecode.usc" % "jdbcdslog" % "1.0.6.2",
    h2database % Test,
    acolyte % Test,
    logback % Test,
    "tyrex" % "tyrex" % "1.0.1"
  ) ++ specs2Deps.map(_ % Test)

  val jpaDeps = Seq(
    "org.hibernate.javax.persistence" % "hibernate-jpa-2.1-api" % "1.0.2.Final",
    "org.hibernate" % "hibernate-core" % "5.4.0.Final" % "test"
  )

  def scalaReflect(scalaVersion: String) = "org.scala-lang" % "scala-reflect" % scalaVersion % "provided"
  val scalaJava8Compat = "org.scala-lang.modules" %% "scala-java8-compat" % "0.9.0"
  def scalaParserCombinators(scalaVersion: String) = CrossVersion.partialVersion(scalaVersion) match {
    case Some((2, major)) if major >= 11 => Seq("org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.1")
    case _ => Nil
  }

  val springFrameworkVersion = "5.1.3.RELEASE"

  val javaDeps = Seq(
    scalaJava8Compat,

    // Used by the Java routing DSL
    "net.jodah" % "typetools" % "0.5.0"
  ) ++ specs2Deps.map(_ % Test)

  val joda = Seq(
    "joda-time" % "joda-time" % "2.10.1",
    "org.joda" % "joda-convert" % "2.1.2"
  )

  val javaFormsDeps = Seq(

    "org.hibernate.validator" % "hibernate-validator" % "6.0.13.Final",

    ("org.springframework" % "spring-context" % springFrameworkVersion)
      .exclude("org.springframework", "spring-aop")
      .exclude("org.springframework", "spring-beans")
      .exclude("org.springframework", "spring-core")
      .exclude("org.springframework", "spring-expression")
      .exclude("org.springframework", "spring-asm"),

    ("org.springframework" % "spring-core" % springFrameworkVersion)
      .exclude("org.springframework", "spring-asm")
      .exclude("org.springframework", "spring-jcl")
      .exclude("commons-logging", "commons-logging"),

    ("org.springframework" % "spring-beans" % springFrameworkVersion)
      .exclude("org.springframework", "spring-core")

  ) ++ specs2Deps.map(_ % Test)<commit_msg>Hibernate Validator upgrade (critical bugfix) (#8977)<commit_after>/*
 * Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
 */
import sbt._
import Keys._

import buildinfo.BuildInfo

object Dependencies {

  val akkaVersion: String = sys.props.getOrElse("akka.version", "2.5.19")
  val akkaHttpVersion: String = sys.props.getOrElse("akka.http.version", "10.1.6")
  val akkaHttpVersion_2_13 = "10.1.3" // akka-http dropped support for Scala 2.13: https://github.com/akka/akka-http/issues/2166

  val sslConfig = "com.typesafe" %% "ssl-config-core" % "0.3.7"

  val playJsonVersion = "2.7.0"

  val logback = "ch.qos.logback" % "logback-classic" % "1.2.3"

  val specs2Version = "4.3.6"
  val specs2Deps = Seq(
    "specs2-core",
    "specs2-junit",
    "specs2-mock"
  ).map("org.specs2" %% _ % specs2Version)

  val specsMatcherExtra = "org.specs2" %% "specs2-matcher-extra" % specs2Version

  val scalacheckDependencies = Seq(
    "org.specs2"     %% "specs2-scalacheck" % specs2Version % Test,
    "org.scalacheck" %% "scalacheck"        % "1.14.0"     % Test
  )

  // We need to use an older version of specs2 for sbt
  // because we need Scala 2.10 support (sbt 0.13).
  val specs2VersionForSbt = "3.10.0"
  val specs2DepsForSbt = specs2Deps.map(_.withRevision(specs2VersionForSbt))
  val specsMatcherExtraForSbt = specsMatcherExtra.withRevision(specs2VersionForSbt)

  val jacksonVersion = "2.9.8"
  val jacksons = Seq(
    "com.fasterxml.jackson.core" % "jackson-core",
    "com.fasterxml.jackson.core" % "jackson-annotations",
    "com.fasterxml.jackson.core" % "jackson-databind",
    "com.fasterxml.jackson.datatype" % "jackson-datatype-jdk8",
    "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310"
  ).map(_ % jacksonVersion)

  val playJson = "com.typesafe.play" %% "play-json" % playJsonVersion

  val slf4jVersion = "1.7.25"
  val slf4j = Seq("slf4j-api", "jul-to-slf4j", "jcl-over-slf4j").map("org.slf4j" % _ % slf4jVersion)
  val slf4jSimple = "org.slf4j" % "slf4j-simple" % slf4jVersion

  val guava = "com.google.guava" % "guava" % "27.0-jre"
  val findBugs = "com.google.code.findbugs" % "jsr305" % "3.0.2" // Needed by guava
  val mockitoAll = "org.mockito" % "mockito-core" % "2.23.4"

  val h2database = "com.h2database" % "h2" % "1.4.197"
  val derbyDatabase = "org.apache.derby" % "derby" % "10.13.1.1"

  val acolyteVersion = "1.0.49"
  val acolyte = "org.eu.acolyte" % "jdbc-driver" % acolyteVersion

  val jettyAlpnAgent = "org.mortbay.jetty.alpn" % "jetty-alpn-agent" % "2.0.9"

  val jjwt = "io.jsonwebtoken" % "jjwt" % "0.9.1"
  // currently jjwt needs the JAXB Api package in JDK 9+
  // since it actually uses javax/xml/bind/DatatypeConverter
  // See: https://github.com/jwtk/jjwt/issues/317
  val jaxbApi = "javax.xml.bind" % "jaxb-api" % "2.3.1"

  val jdbcDeps = Seq(
    "com.zaxxer" % "HikariCP" % "3.3.0",
    "com.googlecode.usc" % "jdbcdslog" % "1.0.6.2",
    h2database % Test,
    acolyte % Test,
    logback % Test,
    "tyrex" % "tyrex" % "1.0.1"
  ) ++ specs2Deps.map(_ % Test)

  val jpaDeps = Seq(
    "org.hibernate.javax.persistence" % "hibernate-jpa-2.1-api" % "1.0.2.Final",
    "org.hibernate" % "hibernate-core" % "5.4.0.Final" % "test"
  )

  def scalaReflect(scalaVersion: String) = "org.scala-lang" % "scala-reflect" % scalaVersion % "provided"
  val scalaJava8Compat = "org.scala-lang.modules" %% "scala-java8-compat" % "0.9.0"
  def scalaParserCombinators(scalaVersion: String) = CrossVersion.partialVersion(scalaVersion) match {
    case Some((2, major)) if major >= 11 => Seq("org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.1")
    case _ => Nil
  }

  val springFrameworkVersion = "5.1.3.RELEASE"

  val javaDeps = Seq(
    scalaJava8Compat,

    // Used by the Java routing DSL
    "net.jodah" % "typetools" % "0.5.0"
  ) ++ specs2Deps.map(_ % Test)

  val joda = Seq(
    "joda-time" % "joda-time" % "2.10.1",
    "org.joda" % "joda-convert" % "2.1.2"
  )

  val javaFormsDeps = Seq(

    "org.hibernate.validator" % "hibernate-validator" % "6.0.14.Final",

    ("org.springframework" % "spring-context" % springFrameworkVersion)
      .exclude("org.springframework", "spring-aop")
      .exclude("org.springframework", "spring-beans")
      .exclude("org.springframework", "spring-core")
      .exclude("org.springframework", "spring-expression")
      .exclude("org.springframework", "spring-asm"),

    ("org.springframework" % "spring-core" % springFrameworkVersion)
      .exclude("org.springframework", "spring-asm")
      .exclude("org.springframework", "spring-jcl")
      .exclude("commons-logging", "commons-logging"),

    ("org.springframework" % "spring-beans" % springFrameworkVersion)
      .exclude("org.springframework", "spring-core")

  ) ++ specs2Deps.map(_ % Test)
{'fraction_non_alphanumeric': 0.17138364779874213, 'fraction_numerical': 0.04067085953878407, 'mean_word_length': 3.441806331471136, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 14}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3501703', 'n_tokens_mistral': 4027, 'n_tokens_neox': 3693, 'n_words': 660}