Vaadin 8 integration


I don’t know when and how will be vaadin 8 included into platform.
My question is the following. Is there any guide or how-to or some tip how I can integrate a vaadin 8 app (frontend or gui module) into the cuba project?
I thinking about using the REST interface to access the backend.
I play recently with vaadin 8.1 responsive gui and a mobile web application feature. I would like to use it as a public interface for a cuba application (the backend gui for administration wil lbe the standard vaadin 7.7).
Can it work like this? Or i need to start a separate vaadin project and simply try to connect it over REST to the cuba app?

Rather I would like to have a vaadin 8 module in that cuba application if it is possible.



Yes you can use Vaadin 8.1 in a separate application and you can even create a separate module in your cuba application project. I’ve tried to do that, you can see the result here: GitHub - cuba-labs/demo-v8-module: Vaadin 8.1 optional module for CUBA application

I’ve created a simple module with Vaadin 8.1 application without CUBA entities and services, just Java Vaadin application. It is deployed to the same tomcat instance as a separate app-v8 web application.

In you project you can follow these steps to add Vaadin 8.1 module:

  1. Declare app-v8 module to settings.gradle file: = 'demo-v8'
include(':app-global', ':app-core', ':app-gui', ':app-web', ':app-v8') // add here
project(':app-global').projectDir = new File(settingsDir, 'modules/global')
project(':app-core').projectDir = new File(settingsDir, 'modules/core')
project(':app-gui').projectDir = new File(settingsDir, 'modules/gui')
project(':app-web').projectDir = new File(settingsDir, 'modules/web')
project(':app-v8').projectDir = new File(settingsDir, 'modules/v8') // and here
  1. Add the following module configuration to build.gradle:

configure(project(':app-v8')) {
    apply(plugin: 'java')
    apply(plugin: 'maven')
    apply(plugin: 'idea')
    apply(plugin: 'cuba')

    sourceSets {
        main {
            java {
                srcDir 'src'
            resources {
                srcDir 'src'

    dependencies {

    task sourceJar(type: Jar) {
        from file('src')
        classifier = 'sources'

    artifacts {
        archives sourceJar

    // Custom deploy task that will copy libs and config files to tomcat
    task deploy(dependsOn: assemble) {
        doLast {
            def tomcatRootDir = project.file(project.cuba.tomcat.dir).canonicalPath

            // copy all jars to tomcat/webapps/app-v8
            project.copy {
                from project.configurations.runtime
                from project.libsDir
                into "${tomcatRootDir}/webapps/app-v8/WEB-INF/lib"
                include { details ->
                    String name =
                    return !name.contains("-sources")

            project.copy {
                from "${project.projectDir}/web"
                into "${tomcatRootDir}/webapps/app-v8"
  1. Create file structure:

-- v8
-- -- src
-- -- web
-- -- -- META-INF
-- -- -- -- context.xml
-- -- -- WEB-INF
-- -- -- -- web.xml
  1. context.xml:

    <!-- Switch off session serialization -->
    <Manager pathname=""/>
  1. web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns=""
            <description>UI class</description>
  1. Create your first UI class, see for example

Please note, that you have to use REST-API to access data of the main system or set up Spring context with cuba-client, cuba-shared-lib dependencies.
In the second case you will be able to execute services and use entities without network operations.

We are planning to introduce support for Vaadin 8.x (latest available version of 8) in the next year together with the Major release 7.