Building Vert.x projects using Gradle

We currently use Vert.x in several internal and external projects. Until the most recent project we where building our Vert.x modules using Maven.

Gradle is our build tool of choice, but the default approach described at the Vert.x site caused several issues:

  • The task of cloning, cleaning and configuring the template project is error-prone;
  • The template project does not support recent Gradle versions >= 2.x;
  • This approach is not compatible with the Gradle support in IntelliJ IDEA.

While starting our most recent project we investigated the possibility of using Gradle again. Instead of using the approach described at the Vert.x site we are using the excellent Vert.x Gradle plugin provided by Daryl Teo.

Using the following Gradle build file we are able to build and run our project from Gradle and import it successfully into IntelliJ IDEA:

Using this configuration exposes the following Vert.x related Gradle tasks:

  • modZip : Creates the module zip
  • debugMod : Run the module including remote debugging
  • runMod : Run the module

More information regarding this marvellous Gradle Vert.x plugin can be found at:
https://github.com/darylteo/vertx-gradle-plugin.

Note that the credits for the Vert.x Gradle plugin fully go to Daryl Teo. This post is only meant to raise the awareness of the existence of the plugin and to complement him for his great work.

 

.

This entry was posted in Gradle, Vert.x by Rob Brinkman. Bookmark the permalink.

About Rob Brinkman

Rob's interests and knowledge focus on application development using open source software. He utilizes his Java experience as a developer hands-on architect on successful JVM based projects. When not online he prefers to spend his time with his kids and kitesurfing.

Leave a Reply

Your email address will not be published. Required fields are marked *