Docs

Documentation versions (currently viewingVaadin 8)

Vaadin 8 reached End of Life on February 21, 2022. Discover how to make your Vaadin 8 app futureproof →

Creating a Project with IntelliJ IDEA

With both Community Edition and Ultimate Edition, you can create a Vaadin application most easily with a Maven archetype and deploy it to a server with a Maven run/debug configuration.

Creating a Maven Project

You can choose to create a Maven project in IntelliJ IDEA. You will not have the application server integration, but can deploy the application to an application server using a run/debug configuration.

  1. Select New Project

  2. In the New Project window, select Maven

  3. Select the Java SDK to be used for the project. Vaadin requires at least Java 8.

  4. Check Create from archetype checkbox

  5. If the Vaadin archetype is not in the list, click Add archetype, enter GroupId com.vaadin, ArtifactId vaadin-archetype-application, and Version LATEST (or a specific version number).

    Click OK in the dialog.

  6. Select the archetype

    idea maven newproject 1

    Click Next.

  7. Give a Maven GroupID, ArtifactID, and a Version for the project, or use the defaults.

  8. Review the general Maven settings and settings for the new project. You may need to override the settings, especially if you are creating a Maven project for the first time.

  9. Finish the wizard.

Creating the Maven project takes some time as Maven fetches the dependencies. Once done, the project is created and the Maven POM is opened in the editor.

Fort more detailed instructions, refer to https://www.jetbrains.com/help/idea/

Compiling the Project

To compile a Vaadin application using Maven, you can define a run/debug configuration to execute a goal such as package to build the deployable WAR package. It will also compile the widget set and theme, if necessary. See "Compiling and Running the Application" for more details.

Compilation is included in the following instructions for deploying the application.

Deploying to a Server

There exists Maven plugins for deploying to various application servers. For example, to deploy to Apache Tomcat, you can to configure the tomcat-maven-plugin and then execute the tomcat:deploy goal. See the documentation of the plugin that you use for more details. If no Maven plugin exists for a particular server, you can always use some lower-level method to deploy the application, such as running an Ant task.

In the following, we create a run/debug configuration to build, deploy, and launch a Vaadin Maven application on the light-weight Jetty web server.

  1. Select Run  Edit Configurations.

  2. Click + and select Maven to create a new Maven run/debug configuration.

  3. Enter a Name for the run configuration. For the Command line, enter package jetty:run to first compile and package the project, and then launch Jetty to run it.

    Click OK.

  4. Select the run configuration in the toolbar and click the Run button beside it.

Compiling the project takes some time on the first time, as it compiles the widget set and theme. Once the run console pane informs that Jetty Server has been started, you can open the browser at the default URL http://localhost:8080/.