Using Vaadin with Maven

Vaadin is a comprehensive framework for developing web applications in Java. The Vaadin web site presents a number of ways to use Vaadin with Maven, but I am not completely satisfied with any of those. Here is how I do it.

Use a pom.xml like this:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi=""

	<name>The App</name>



And a src/main/webapp/WEB-INF/web.xml like this:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns=""

	    <param-name>productionMode</param-name> <!-- Vaadin parameter -->


In this way, the VAADIN directory with themes and widgetsets from vaadin.jar will be automatically copied to the produced web-app where it can be served as static content for optimal performance. You can also put your own themes under src/main/webapp/VAADIN/themes and they will be merged with the default themes.

Build a .war file for your application using mvn package. You can also quickly test it using Jetty by running mvn jetty:run-exploded (jetty:run won’t work properly).

This entry was posted in Java, web. Bookmark the permalink.

2 Responses to Using Vaadin with Maven

  1. morganriley says:

    hi, I am new to maven and I wanted to ask you how can I create an archetype in maven using your pom and web.xml so that I can create new projects with that structure?

    thanks for your help, best regards!

  2. Sorry, I am not familiar enough with Maven to create archetypes.

Comments are closed.