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

group = "com.example"
version = "1.0.0"
description = 'spring-core-6'

repositories {
    mavenCentral()
}

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

dependencies {
    implementation("org.springframework.boot:spring-boot-starter-web")
    implementation 'org.springframework.boot:spring-boot-starter-webflux'

    testImplementation("org.springframework.boot:spring-boot-starter-test")
    testImplementation("junit:junit")
    testImplementation("org.assertj:assertj-core:3.24.1")
}


repositories {
    mavenCentral()
}

java {
    sourceCompatibility = JavaVersion.VERSION_21
}

test {
    useJUnitPlatform()
}

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

compileJava {
    options.compilerArgs.addAll(
                                ['--enable-preview'])
}

tasks.withType(JavaCompile).configureEach {
    options.compilerArgs += ['--enable-preview']
}

tasks.withType(Test).configureEach {
    jvmArgs += '--enable-preview'
}

tasks.withType(JavaExec).configureEach {
    jvmArgs += '--enable-preview'
}

