plugins {
  id "java"
  id "idea"
  id "org.springframework.boot" version "3.4.5"
}

apply plugin: "io.spring.dependency-management"

springBoot {
  buildInfo()
}

ext {
  postgresqlVersion = "42.7.5"
  jsonVersion = "20250517"
  hypersistenceVersion = "3.9.10"
  okhttpVersion = "4.12.0"
  lombokVersion = "1.18.38"
  mockServerVersion = "1.0.17"
  nettyVersion = "4.2.2.Final"
}

repositories {
  mavenLocal()
  maven {
    url = uri('https://repo.maven.apache.org/maven2/')
  }
}

configurations.configureEach {
  exclude module: 'slf4j-jdk14'
}

dependencies {
  implementation "org.springframework.boot:spring-boot-starter"
  implementation "org.springframework.boot:spring-boot-starter-web"
  implementation "org.springframework.boot:spring-boot-starter-data-jpa"
  implementation "org.springframework.boot:spring-boot-starter-validation"
  implementation "org.postgresql:postgresql:${postgresqlVersion}"
  implementation "org.json:json:${jsonVersion}"
  implementation "io.hypersistence:hypersistence-utils-hibernate-63:${hypersistenceVersion}"
  implementation "com.squareup.okhttp3:okhttp:${okhttpVersion}"
  implementation "org.projectlombok:lombok:${lombokVersion}"
  compileOnly "org.projectlombok:lombok:${lombokVersion}"
  annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
  testImplementation "org.springframework.boot:spring-boot-starter-test"
  testImplementation "software.xdev.mockserver:client:${mockServerVersion}"
  testImplementation "software.xdev.mockserver:server:${mockServerVersion}"
  testImplementation "io.netty:netty-all:${nettyVersion}"
}

group = "com.amnesica"
version = "4-1-2"

java {
  sourceCompatibility = JavaVersion.VERSION_17
  targetCompatibility = JavaVersion.VERSION_17
}

bootJar {
  destinationDirectory.set(file("$rootDir/prod"))
}

test {
  useJUnitPlatform()
}
