Serve static JS from CDN

Enjoy Vaadin add-ons,
but never compile your
Vaadin widgetset again.

1. Insert magic to your pom.xml:

<build>
  <plugins>
    <plugin>
        <groupId>in.virit.vwscdn</groupId>
        <artifactId>vwscdn-maven-plugin</artifactId>
        <version>1.3.6</version>
        <executions>
            <execution>
                <phase>generate-sources</phase>
                <goals>
                    <goal>generate</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
  </plugins>
</build>
                    
* At this point you should get rid of widgetset reference in your web.xml/servlet/UI and all *.gwt.xml files in your project.

2. Use any of the magical Vaadin add-ons:

<dependencies>
    <dependency>
        <groupId>org.vaadin.addons</groupId>
        <artifactId>ratingstars</artifactId>
        <version>2.1</version>
    </dependency>
</dependencies>

<!-- Vaadin add-ons are in maven.vaadin.com-->
<repositories>
   <repository>
      <id>vaadin-addons</id>
      <url>http://maven.vaadin.com/vaadin-addons</url>
   </repository>
</repositories>
                    

4/5

3. Build and run your project:

mvn clean install jetty:run
                    
(or whatever the method you prefer to deploy your app).

...enjoy magic.

  • Save minutes on every build.
  • No manual configuration for Vaadin add-ons.
  • Get optimized widgetset for the components you use.
  • Automatic GZIP for faster loading times.
  • Offload your production server from static resources.
  • Nothing to install on production server.

TIP:
If you are an existing Vaadin developer, now you can get rid off the following:

  1. @Widgetset annotation (or widgetset parameter in @VaadinServletConfiguration)
  2. YourAppWidgetset.gwt.xml
  3. vaadin-maven-plugin*
*) Vaadin maven plugin may still be required if you use it for compiling custom themes, but you can still comment out update-widgetset and compile goals.

How does it work?

image/svg+xmlUser Your app cdn.virit.in cloud magic Request an optimized pre-compiled Vaadin transform="translate(876.2824,235.4428)" id="g3260" />widget set You Automagically configure your app for cdn.virit.in Efficiently serve static resources Maven plugin for cdn.virit.in Enjoy Create Use