Maven is a commonly used build and dependency management system. The Vaadin core library and all Vaadin add-ons are available through Maven. You can use a Maven with a front-end from Eclipse or NetBeans, or by using the command-line as described in this section.
In addition to regular Maven, you can use any Maven-compatible build or dependency management system, such as Ivy or Gradle. For Gradle, see the Gradle Vaadin Plugin. Vaadin Plugin for Eclipse uses Ivy for resolving dependencies in Vaadin projects, and it should provide you with the basic Ivy configuration.
You can create a new Maven project with the following command (given in one line):
The parameters are as follows:
Creating a project can take a while as Maven fetches all the dependencies. The created project structure is shown in Figure 2.8, “A New Vaadin Project with Maven”.
Before the application can be deployed, it must be compiled and packaged
as a WAR package. You can do this with the
The location of the resulting WAR package should be displayed in the command output. You can then deploy it to your favorite application server.
The easiest way to run Vaadin applications with Maven is to use the light-weight Jetty web server. After compiling the package, all you need to do is type:
The special goal starts the Jetty server in port 8080 and deploys the
application. You can then open it in a web browser at
If you use Vaadin add-ons that include a widget set or make your custom widgets, you need to enable widget set compilation in the POM. The required configuration is described in Section 17.4, “Using Add-ons in a Maven Project”.