DS Vaadin Flow Gradle Plugin Jun 29th, 2020

Project structure

The folder structure for Vaadin Flow projects follow the standard Java folder recommendations. Here is the folder structure which you will get if you run the vaadinCreateProject task.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
.
├── build.gradle
├── src
│   └── main
│       ├── java
│       │   └── com
│       │       └── example
│       │           └── vaadinflowplugintest
│       │               ├── HelloButton.java
│       │               └── VaadinFlowPluginTestView.java
│       ├── javascript
│       │   └── hello-button.js
│       └── stylesheets
│           └── theme.css

This is a Java project, if you are using Groovy or Kotlin then the folder structure might vary slightly according to the language specific locations.

Java Sources

1
2
3
4
5
6
7
8
├── src
│   └── main
│       ├── java
│       │   └── com
│       │       └── example
│       │           └── vaadinflowplugintest
│       │               ├── HelloButton.java
│       │               └── VaadinFlowPluginTestView.java

All the Java sources are located in src/main/java. This is the standard Java convention.

Polymer templates and other Javascript imports

1
2
3
4
├── src
│   └── main
│       ├── javascript
│       │   └── hello-button.js

The plugin expects to find all the javascript sources you want to include in your Javascript bundle to be located under the src/main/javascript source directory.

src/main/javascript directory is analogous to the frontend directory in the Maven plugin.

Theme and other CSS files

1
2
3
4
├── src
│   └── main
│       └── stylesheets
│           └── theme.css

All stylesheets should be placed under the stylesheets folder.

All stylesheets placed here will be automatically converted into a JS Polymer module at build time so you can use them to style Polymer templates as well.