/ Vaadin Flow Framework

Building Vaadin Flow apps with Gradle

Right now Vaadin 10 (a.k.a. Flow) is in Beta stage so this is a good opportunity to start looking into how you can leverage Gradle to build your apps.

The architecture for Vaadin 10 has changed significantly, especially when it comes to the client side part of the Vaadin application that previously was built with Google Web Toolkit (GWT). This means that the old Gradle plugin hosted at https://github.com/johndevs/gradle-vaadin-plugin no longer will work properly and something else is needed.

While it is fully possible today to build a Vaadin 10 application with Gradle without any plugins, it is tedious as you will need to know the details of how Vaadin publishes every component, which repositories are needed, how you should fix incompatibilities with the Maven versioning and manually creating the folder structures and so on.

To this end I am happy to announce a new Gradle plugin for Vaadin Flow!

The new plugin will solely target the Vaadin 10+ component eco-system and will allow you as an app developer to focus on the application itself rather than on the build system low-level details. The new plugin is hosted at https://github.com/devsoap/gradle-vaadin-flow

Getting started

Today the first version of the plugin (1.0.0.M1) is available in the Gradle plugin repository. The plugin can be included in your build.gradle by adding it to the plugins{}-block.

plugins {
    id 'com.devsoap.vaadin-flow' version '1.0.0.M4.1'   

For a full example of how to get started there is now a Wiki page available at https://github.com/devsoap/gradle-vaadin-flow/wiki/Getting-started-(no-IDE)

Also if you have used https://github.com/johndevs/gradle-vaadin-plugin then one thing that have changed is how dependencies are handled. The plugin no longer automatically configures everything, but uses a more explicit approach. I suggest reading up on it in the Wiki https://github.com/devsoap/gradle-vaadin-flow/wiki/Dependency-management

Maturity and the future

The development of the plugin is right now divided into milestones where each milestone will bring one new feature-set.

This initial first version of the plugin (M1) is in many ways limited and only supports building Vaadin Flow applications using WebJars but will allow you to get started building and running a project on modern browsers without any problems.

In later versions also building using NPM and other Javascript eco-system tools will be supported as well as integrations with other Java frameworks will be introduced.

While the functionality is being built the M(x) notation will be used in the release version denoting the milestone released. The milestones are listed at https://github.com/devsoap/gradle-vaadin-flow/milestones

From a maturity standpoint you can consider the M(x) releases Alpha releases for 1.0 as functionality and API might change between milestone releases.

For those developing on the Vaadin 8 Framework and using https://github.com/johndevs/gradle-vaadin-plugin that plugin will also in time start migrating to a similar API that this new plugin uses so upgrading should be gradual and easy once the time comes.