plugins { java } java { toolchain { languageVersion.set(JavaLanguageVersion.of(21)) } } repositories { mavenLocal() mavenCentral() } val libs = versionCatalogs.named("libs") dependencies { compileOnly(libs.findLibrary("lombok").get()) annotationProcessor(libs.findLibrary("lombok").get()) testImplementation(platform(libs.findLibrary("junit-bom").get())) testImplementation(libs.findLibrary("junit-jupiter").get()) testCompileOnly(libs.findLibrary("lombok").get()) testAnnotationProcessor(libs.findLibrary("lombok").get()) } tasks.withType { options.compilerArgs.add("--enable-preview") } tasks.withType { useJUnitPlatform() jvmArgs("--enable-preview") } val application = extensions.findByType() application?.apply { applicationDefaultJvmArgs = listOf("--enable-preview") }