Skip to main content

Posts

Showing posts from January, 2022

How to use Groovy + GraalVM + Quarkus together?

If you are one among those who like Groovy for its simplicity and tight integration with Java (and not for its dynamic capabilities) and wondered how to write Groovy code in a Quarkus application and compile it to native using GraalVM? I have you covered. You dont have to look anywhere else. Scope groovy code as part of quarkus application statically compilable groovy code with no dynamic feature compile the final application to native code using graalvm Code example can be found here . Steps Create a quarkus application as outlined here Add your groovy class under src/main/java Annotate your groovy class with @groovy.transform. CompileStatic create a file called application.properies under src/main/resources folder with the following content. quarkus.native.additional-build-args=\ --allow-incomplete-classpath, \ --report-unsupported-elements-at-runtime, \ --initialize-at-build-time, \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils\\,groov