plugins {
    id 'java'
    id 'org.springframework.boot' version '3.3.2'
    id 'io.spring.dependency-management' version '1.1.6'
}

group = 'com.kospo'
version = '0.0.1-SNAPSHOT'

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17)
    }
}

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

// ✅ Spring Boot 실행 시 JVM 옵션
bootRun {
    jvmArgs = [
            '-Xms32g',
            '-Xmx32g',
            '-XX:+UseZGC',
            '-XX:+ZGenerational',
            '-XX:MaxMetaspaceSize=512m',
            '-XX:+ZUncommit',
            '-XX:ZUncommitDelay=300'
    ]
}

repositories {
    mavenCentral()
}
ext['queryDslVersion'] = '5.0.0'


dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-data-rest'
//    implementation 'org.springframework.boot:spring-boot-starter-data-redis'
    implementation 'org.springframework.boot:spring-boot-starter-web-services'
    implementation 'org.springframework.boot:spring-boot-starter-websocket'
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-amqp'
    implementation 'org.springframework.boot:spring-boot-starter-reactor-netty'
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-webflux'
    // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent
    implementation 'org.springframework.retry:spring-retry:2.0.8'
    implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'


    implementation 'org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16'
    implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5'
    implementation 'com.github.ulisesbocchio:jasypt-maven-plugin:3.0.5'

    implementation 'org.jetbrains:annotations:24.0.0'

    implementation "com.querydsl:querydsl-jpa:${queryDslVersion}:jakarta"
//    annotationProcessor "com.querydsl:querydsl-apt:${queryDslVersion}"
    annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta"
    annotationProcessor "jakarta.annotation:jakarta.annotation-api"
    annotationProcessor "jakarta.persistence:jakarta.persistence-api"

    implementation 'com.google.code.gson:gson:2.9.0'
    implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3'
    implementation 'com.fasterxml.jackson.core:jackson-core:2.15.3'
    implementation 'com.fasterxml.jackson.core:jackson-annotations:2.15.3'
    implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.3'

    implementation 'javax.xml.bind:jaxb-api:2.3.1'
    implementation 'org.modelmapper:modelmapper:3.2.0'
    implementation 'org.apache.commons:commons-lang3:3.13.0'
    implementation 'commons-codec:commons-codec:1.16.0'
    implementation 'org.apache.commons:commons-dbcp2:2.10.0'
    implementation 'org.apache.commons:commons-pool2:2.12.0'
    implementation 'commons-io:commons-io:2.15.0'
    implementation 'org.apache.commons:commons-email:1.5'
    implementation 'org.postgresql:postgresql:42.7.3'


    // sockjs
    implementation 'org.webjars:sockjs-client:1.5.1'
    implementation 'org.webjars:stomp-websocket:2.3.4'
    implementation 'org.webjars:jquery:3.1.1-1'
    implementation 'org.webjars:bootstrap:5.3.3'

    implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5'
    implementation 'com.github.ulisesbocchio:jasypt-maven-plugin:3.0.5'

    //external jar
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    runtimeOnly group: 'io.netty', name: 'netty-resolver-dns-native-macos', version: '4.1.112.Final'
    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    annotationProcessor 'org.projectlombok:lombok'
//    testImplementation 'org.springframework.boot:spring-boot-starter-test'
//    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}


tasks.named('test') {
    useJUnitPlatform()
}
