plugins {
    id 'java'
}

repositories {
    mavenCentral()
}

dependencies {
    implementation libs.javalin   // Pulling in Javalin
    implementation libs.jackson   // For JSON serialization of persons 
    implementation libs.slf4j     // To see some Javalin logging
    compileOnly libs.lombok
    annotationProcessor libs.lombok

    implementation libs.postgresql
    implementation libs.hibernate
    implementation libs.hibernate.validator
    implementation libs.hypersistence
    implementation libs.validation.api
    annotationProcessor libs.hibernate.jpamodelgen
    implementation libs.el
    annotationProcessor libs.openapi.annotation
    implementation libs.javalin.openapi
    implementation libs.javalin.swagger
    implementation libs.javalin.redoc
    testImplementation(platform(libs.junit.bom))
    testImplementation "org.junit.jupiter:junit-jupiter"
}

task fatJar(type: Jar) {
    manifest {
        attributes 'Main-Class': 'de.thpeetz.kontor.Main'
    }
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
    from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
    with jar
}

build.dependsOn fatJar

wrapper {
    gradleVersion = "9.2.1"
}
