7alpha3 JAR size blowup

In Vaadin 7alpha3 the Vaadin JAR file size has gone from 5.2M to 53M. This is a huge (10x) increase and causing me problems. There are other problems as well, such as the fact that it includes a version of Xerces which overrides the one I’ve been using (but that’s easy to work around).

I realize this “all in one” approach is more convenient for certain people/situations, but in the process don’t disregard the needs of people who need to deploy more intelligently.

In one of the announcements I thought I read there was going to be a “deployment” JAR that didn’t have all the unnecessary GWT stuff, i.e., a 5.2M JAR equivalent to what we had before.

Where is this “deployment” JAR? It’s not found anywhere under

Please provide a “deployment” JAR equivalent to what we had before. We can handle it :slight_smile:

In the meantime, please provide instructions on how to take the new 53M JAR file and strip it back down. E.g., a list of
delete patterns.


Answering my own question, this will create a traditional “deployment JAR” from the newly bloated Vaadin JAR:

$ zip -q -U vaadin.jar --out vaadin-stripped.jar 'com/vaadin*' 'VAADIN*'
$ zip -q -d build/war/lib/vaadin-stripped.jar 'com/vaadin/external/com*' \
  'com/vaadin/external/mx4j*' 'com/vaadin/external/net*' 'com/vaadin/external/org*'

If you are building your own widgetset, you can also do this:

$ zip -q -d vaadin-stripped.jar \

You might also want to keep the JAR manifest (META-INF/MANIFEST.MF) although for most deployments it is not needed.
Note that JAR specifications say it must be the first entry in the ZIP.

If you really want to minimize the JAR size and don’t need to recompile a widgetset with it or debug using it, you can even remove .java files. However, this should rarely be necessary.

Thanks, didn’t think of that.

Although I am generating a widgetset, this is done prior to stripping the JAR. So I’ve added
to the
zip -d

I’m also stripping out all the
files because these have been “unpacked” into the WAR as recommended, and
because I’m using my own compiled widgetset.

The resulting
is only 2MB!

From this experience I believe it makes sense for Vaadin to ship multiple JARs:

  • vaadin-dev.jar
    - Used to compile Java classes and build widgetsets (same as the current

  • vaadin-runtime.jar
    - Equivalent to the 2MB
    described above

  • vaadin-resources.jar
    - Contains all the
    files (themes, icons, etc) not including default widgetset

  • vaadin-widgetset.jar
    - Contains the compiled default widgetset

So a deployment (i.e. WAR file) would include
and, if the standard widgetset were needed,
. The latter would be included by default in “simplified” scenarios.

I’ve filed
issue #9094
to track this.