Setting up your Quarkus Microservice with Kotlin & Gradle

Andreas Eberle
arconsis
Published in
2 min readDec 6, 2022

Setting up a new project with the framework of your choice can often be a tedious task. Often, one resorts to copy-pasting an old project and removing what’s not needed.

With Quarkus, this is different. In this guide, I will show you how you can easily generate your new project with a few clicks! You can even choose if you want your project to be written in Java or Kotlin and if you want to use Maven, Gradle or Gradle with Kotlin DSL.

Generate a Quarkus Project with code.quarkus.io

In this guide, we will use code.quarkus.io to create a new project. Just click on the link to open the page.

screenshot of code.quarkus.io

On the screenshot above, the most important sections have been marked.

  1. Here you can select the version of Quarkus you want to use. Usually, you want to go with the newest version when you start a new project.
  2. Specify the group and artifact id of your new project as well as the build tool. By default Maven is selected, but you can just select “Gradle” (with Groovy) or “Gradle with Kotlin DSL”.
  3. Configure your artifacts starting version and the Java version to use. Java 17 is currently default but Java 11 is also supported. Furthermore, you can specify if you want some starter code generated. This just generates some starter examples (e.g. for REST endpoints) depending on the Quarkus extensions you select (see 5).
  4. Here you search for Quarkus extensions by their name.
  5. The extensions matching your search query will show up here. Just tick the checkbox to add the extension to your project. On the right side, you can also click the small arrow to get the Maven or Gradle dependency string.
  6. Finally, when you’ve selected your dependencies, just click on “Generate you application”. By default it will download a .zip file. But you can also push the new project to Github by clicking on the small arrow.

Note: Of course, you can easily add more Quarkus extensions to your project once you’ve created it. Just check your pom.xml or your build.gradle / build.gradle.kts file.

Generate a Kotlin project with RESTEasy and Gradle

As an example, you can select Gradle as your Build Tool and add the following extensions:

  • RESTEasy Reactive
  • RESTEasy Reactive Jackson
  • Kotlin

The result should look like this.

Share your Setup

If you want to share your projet setup, just copy-paste the URL from your browser. It contains all the selected options already. So you can easily bookmark your favorite setup or share it with your colleague.

Summary

With code.quarkus.io, you can easily and quickly generate a new Quarkus project using Maven, Gradle, Java, Kotlin and all the Quarkus extensions. On top, you can share it with your colleagues or bookmark it.

--

--

Andreas Eberle
arconsis

Solutions Architect & Software Engineer @arconsis