building the WAR (without eclipse)

Im having an issue with the defaultwidgetset and the theme which is in the VAADIN directory.

The WAR file for my application is built with maven, but the part that is missing is the VAADIN directory.

Im not quite seeing how this can be added to my war, even after referring to the book of vaadin.

Shall I just include the VAADIN directory in a src\main\webapp directory of my maven project so it can be included in the WAR?


I’m not sure, but try to include the VAADIN directory into src/main/resources.


I pared down the VAADIN directory with only the reindeer theme which I use, and the defaultwidgetset, and added this to the src/main/webapp directory in my maven project.

The WAR deploys fine from tomcat now, and the window initializes fine with the widgets I am using on my application.

Are you using Vaadin 6.6.7?

Normally, the Vaadin servlet can serve static resources in /VAADIN directly from the JAR as long as the context path /VAADIN/* is mapped to the Vaadin servlet in your web.xml. In development environments, this is the recommended configuration. For production use, to let the server serve them directly, you might want to configure your POM to produce an assembly where those resources are extracted from the JAR at build time and /VAADIN/* is not mapped to the servlet in web.xml.

A security fix introduced in Vaadin 6.6.7 was too strict in limiting access to those files, causing them to be inaccessible in certain application servers. This will be fixed in Vaadin 6.6.8, due very soon.

Note that when using reindeer, the base and runo themes might also be required for some icons and other images - CSS from them is already included in the packaged version of reindeer/styles.css .

I like to create the war file without eclipse too. I have no clue how to do this. Can anyone give me a hint or is there a good tutorial?
Btw. I use maven at my project. Are there differences in compiling the war?

If your project has been created from a suitable Vaadin archetype, it should already have “war” as the “packaging” setting. Thus, “mvn package” should be enough to create the WAR.

For information on using Maven and Vaadin together, see e.g.
this book chapter
and use Google for more (“vaadin maven”).

Hi Henri. Thank you very much! mvn package works :slight_smile:

I have a second question. How can I build the war without maven? I tried

jar -cvf ./myproj.war ./*

at the webapp folder. This didn’t work. The war file was not build correctly. Could that be because that maven is used?

There is much more involved in building a WAR than just JARing the webapp directory. In addition to getting the compiled classes in the right place and the resources in the right place, you need to include the correct dependencies (and their dependencies etc.) properly.

If you are using a Maven project, you should build the WAR with Maven. Don’t try to package it by hand unless you really know what you are doing.

With other dependency management systems based on Maven repositories (e.g. Ivy), you need to ask the dependency management system which dependencies need to be deployed (included in the WAR) and which not.

If you extract all the dependency JARs from the ZIP, you need to check separately which need to be deployed, which can be deployed and which shouldn’t. That is not trivial at the moment, should get a little easier when
is addressed.

Thank you very much for this detailed answer !