// Enable for Java Compiler on src/main/java
compileJava {
options.compilerArgs += ["--enable-preview"]
}
// Enable for Java Compiler on src/test/java
compileTestJava {
options.compilerArgs += ["--enable-preview"]
}
// Enable for running tests
test {
jvmArgs '--enable-preview'
}
// Enable for Quarkus DevMode runner which was my main use-case
quarkusDev {
jvmArgs '--enable-preview'
}