Using Vaadin with Maven 2

Hi All,
After spending a bit of time trying to deploy my Vaadin application with custom widgets using Maven 2, I got it working with the codehaus gwt-maven plugin. In case anybody else is coming up against the same problem, I created a Maven archetype that will generate a Maven version of the Vaadin Color Picker Demo application.
To download the Archetype, and for instructions on how to use it, check out the wiki:


Awesome addition to the toolset Daniel! Great work!


Wow that’s great !

So much easier than using an antrun task ^^


Looks like there is a typo in the maven code you posted on the page

I could get it to work with the following command

mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=org.stephane -DartifactId=vaadin-demo

which reads a trailing s at org.apache.maven.archetypes

The current archetype has a slight isssue when launching jetty using mvn jetty:run.

This is a known bug with jetty and mvn. It has been documented here →

Due to this bug, when running mvn jetty:run from the vaadin project, you get the following error…



Failed to configure plugin parameters for: org.mortbay.jetty:maven-jetty-plugin:6.1.19

(found static expression: 'src/main/webapp,/Users/dummy/workspace/vaadin.test/target/vaadin.test-0.0.1-SNAPSHOT' which may act as a default value).

Cause: Cannot assign configuration entry ‘resources’ to ‘class [Lorg.mortbay.resource.Resource;’ from ‘src/main/webapp,/Users/dummy/workspace/vaadin.test/target/vaadin.test-0.0.1-SNAPSHOT’, which is of type class java.lang.String

You can resolve this issue by changing the pom file as shown below… I have commented the original entry and changed it to what is shown below:

        <!-- A simple Jetty test server at http://localhost:8080/vaadin.test
             can be launched with the Maven goal jetty:run and stopped with jetty:stop -->
                <!-- Redeploy every x seconds if changes are detected, 0 for no automatic redeployment -->
                <!-- make sure Jetty also finds the widgetset -->
                    <baseResource implementation="org.mortbay.resource.ResourceCollection">
                        <!--<resources>src/main/webapp,${}/${}</resources> -->


The Jetty issue workaround has been added to vaadin-archetype-sample version 1.0.5, where the dependencies on Vaadin and GWT versions were also updated (

The typo in the archetype name in has been corrected.

Hello all,

I’m having troubles trying to compile a custom widget with Maven 2 using gwt-maven-plugin (version 1.2) and vaadin-maven-plugin (version 1.0.0).

I configured my maven project just as it says on section “Adding widgetset compilation to an existing Vaadin project” of
and after execute the command mvn clean install everything looks fine except for the following messages:

 [gwt:resources {execution: default}]

 auto discovered modules [com.example.widgetset.MyWidgetSet]

 1 source files copied from GWT module com.example.widgetset.MyWidgetSet

 Compiling 160 source files to /Users/me/example/workspace/my-project/target/classes
 [gwt:compile {execution: default}]

 using GWT jars from project dependencies : 1.7.0
 auto discovered modules [com.example.widgetset.MyWidgetSet]

 establishing classpath list (scope = compile)
 com.example.widgetset.MyWidgetSet is up to date. GWT compilation skipped
 [vaadin:update-widgetset {execution: default}]

 auto discovered modules [com.example.widgetset.MyWidgetSet]

 Updating widgetset com.example.widgetset.MyWidgetSet
 establishing classpath list (scope = compile)
 Feb 11, 2010 6:51:08 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
 INFO: Widgetsets found from classpath:
 	com.vaadin.terminal.gwt.DefaultWidgetSet in jar:file:/Users/me/.m2/repository/com/vaadin/vaadin/6.2.2/vaadin-6.2.2.jar!/
 	com.example.widgetset.MyWidgetSet in file:/Users/me/example/workspace/my-project/src/main/java

After that, the build is successful but the gwt compiler did not compile my custom widget. The VAADIN/widgetsets folder was created under the target/artifactId-version folder but it is empty, no widget in there.

Any idea or suggestion?

I believe you might have have run into one of two Maven GWT plugin bugs:

You could try the gwt-maven-plugin version 1.3 (or a snapshot) in which both should be fixed.

Thank you very much Henri!!!

I never thought that the last stable release (gwt-maven-plugin 1.2) was completely useless. I think this should be reported in the wiki article “MavenIntegration” don’t you think?

Thanks again.

I have another question:

I inherited my widgetset from com.vaadin.terminal.gwt.DefaultWidgetSet and at the moment of building the project with maven, all the default components were included successfully but I noticed that the default themes were not created on VAADIN/themes.

Is there something missing here or the vaadin-maven-plugin doesn’t consider the themes and I have to do that manually?

One more time thank you!!!

In basic development use, you don’t need copies of the standard themes in VAADIN/themes - they can be served by the Vaadin ApplicationServlet directly from the JAR as long as you have the correct servlet mapping for /VAADIN in your web.xml . In fact, it is usually better not to copy in development environments them unless you need them so that you would not run into mismatching theme versions when upgrading Vaadin. Your own themes should, of course, reside in VAADIN/themes.

In production environments, on the other hand, it does make sense to copy also the basic themes out of the JAR and have the web server serve them statically for improved performance.

Hi, I cant get this archetype to work. I get:

Requested resource [VAADIN/widgetsets/]
not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.

Steps to recreate:

  1. have the latest eclipse helios with m2eclipse plugin.
  2. file->new->other->Maven Project-
  3. chose vaadin-archetype-sample
  4. project loads up in eclipse
  5. run as->Maven package
  6. Project properties->Server assign my local tomcat 6 server.
  7. run as-> run on server.
  8. tomcat loads up, and a webpage loads up in clipse with a spinning graphic in the center, and a message pops up:

Requested resource [VAADIN/widgetsets/]
not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.

Any documentation on how to get this sample working?

Anyone know where I might find a widgetset and/or theme, and how I can add it to the pom.xml as a dependency?

Is ther eany documentation for how to run these sample apps, e.g. what maven targets are supplied?

As mentioned in a previous post, the GWT compiler Maven plugin had some bugs, and the archetype still used an old version of that plugin.

You could try the latest (1.3.0) version of the archetype, which uses the correct version of the plugin.
At least running “mvn clean package” should then also compile the widgetset correctly. I’m not sure if m2eclipse does this automatically when you select “Run on server” - if it does not seem to work, try Run As → “Maven package” first. If you have problems with this approach, you could also try to see if “mvn clean package jetty:run” works in your environment.

These are somehow listed on
the wiki page
, but the page should be updated with more current information.


  • vaadin:update-widgetset
    updates the widgetset definition if you have added add-ons with client side components to the project

  • jetty:run
    launches an embedded Jetty for testing your servlet

  • gwt:run
    launches the GWT development mode shell for debugging of client side code - note that you also need to change the POM to enable remote debugging, and run the server (e.g. jetty:run) in a separate process

  • gwt:clean
    should be run automatically with the current plugin when you change the widgetset definition or client side code - you should not need to call them explicitly anymore

Does anyone else get this error:

 The plugin 'org.apache.maven.plugins:maven-vaadin-plugin' does not exist
or no valid version could be found

The plugin is right there in the m2 directory:


I have no idea what’s going on … :mellow:

Maven seems to be looking for the Vaadin plugin under org.apache.maven.plugins . Check that you are using the groupId com.vaadin for the plugin in your pom.xml .

Well spotted, i should have seen that.

I spent a lot of time the last couple of days trying to get VisualizationsForVaadin to work and i now i finally get it to run update-widgetset without errors. In case someone else is facing the same problems, this is the error i was getting:

 Exception in thread "main" The system cannot find the path specified
         at Method)
         at com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder.updateWidgetSet(
         at com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder.main(

And the solution is to get the new version of Vaadin. The versions i use now without errors:
Vaadin: 6.4.0
VisualizationsForVaadin: 0.0.5
gwt-user: 2.0.4
gwt-visualization: 1.1.0
vaadin-maven-plugin: 1.0.0
WTP: 2.0
gwt-maven-plugin: 1.3-SNAPSHOT
Java 1.6, tomcat 6 and eclipse Galileo

Having said that - all install does is make an empty gwt folder in my target directory. I still dont have VisualizationsForVaadin running. :frowning:

Did you try running
explicitly? Does that make any difference? Any messages about widgetset compilation?

Sorry to prolong the agony but I’m sort of new to Vaadin/Maven (I’m revisiting Maven after several years).

I’ve just ran the ‘mvn jetty:run’ command against Vaadin’s clean project archetype:

and Maven (2.2.0, OS X 10.6.4, JDK 1.6.0_20) is complaining about:

which is true as


‘SNAPHOT’ folder is created in the ‘target’ output folder.

I visited my pom.xml file, Vaadin is version 6.4.0, the Vaadin archetype
“1.0.5 resourceAsCSV” fix


in place, I tried/clutched at ’
mvn gwt:compile
’ but nothing.

Please help, as I’m proposing this technology to my boss at work, and in it’s current state, Maven build errors are not going to sell him the idea of either Maven or Vaadin (I


to develop with cool bits of technology to remain sane :grin: )



P.S. I tried this with both the clean and sample Maven archetypes.



Hey, we like to bring solutions sometimes, not just problems :wink:

  1. I upgraded to Maven 2.2.1 (May not be necessary)
  2. After generating/downloading the Vaadin sample archetype, I did a ‘mvn clean package’ as suggested. This built the missing ‘widgetset’ (nb, ‘mvn gwt:compile’ did
    do this).
  3. finally, I ran ‘mvn jetty:run’, and was greeted by a colour chart at http://localhost:8080/<my_vaadin_project_artifact_name>
  4. That’s it!