What libs and files are used for correct app work?

I created basic Vaadin app and integrated it to existing project to jetty (there’re several web-apps that are already running on it). I ran at several problems which I solved (as workaround) in a rude way - added some libs, themes etc. And at the end my app started to work.

Here is the list of what I’ve done:

  1. Added libs: vaadin-server, vaadin-shared, json and jsoup → application refused to start without them.
  2. I received error about vaadinBootstrap.js and added it manually to WEB-INF/VAADIN/.
  3. On error about AppWidgetSet or DefaultWidgetSet, I copied widgetsets/com.comodo.AppWidgetSet to WEB-INF/VAADIN
  4. Everything started to work but without theme (reindeer). I took themes/reindeer from vaadin-sources-6.8.2.jar and added to WEB_INF/VAADIN.

As you see, there’re a lot of strange actions I had to do. Points 2-4 were integrated to existing .jar file of another web-app. It is weird, but the problem is with web.xml configuration and it isn’t the question of this topic :slight_smile:

The questions are the following:

  • What base set of vaadin libs should be deployed with web-app?
  • Where can I take themes in Vaadin 7? If I correctly understood a theme should generate on fly with vaadin-theme and vaadin-theme-compiler. Correct me if I’m wrong.
  • Is it necessary to add widgetsets (app. 28MB) to WEB-INF/VAADIN, can I start my app without it?
  • Where do application search for resources like bootstrap, widgetsets or themes during its work? What is its starting point? Near web.xml or does it also look for resources in /web/resources folder (Jetty)?

These are all questions I have at the moment :slight_smile:

Thank you for your reply in advance.

I’m using:
vaadin-server
vaadin-client
vaadin-theme-compiler
vaadin-themes
vaadin-client-compiler

If you’re not going to be compiling your own widgetset, I believe you must swap vaadin-client-compiler for vaadin-client-compiled.

If you’re using beta10 and Maven (or Ivy), there is a bug in one of the POMs so you may need to add an exclusion of vaadin-shared-deps to vaadin-theme-compiler to get around the missing json error.

That should be all you need to get up and running. I think you could also simplify the list a bit because of transitive dependencies between the components but I have them all explicitly listed.

-mike

I also use the vaadin-maven-plugin to compile my custom widgetset:

<plugin>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-maven-plugin</artifactId>
        <version>${vaadin.version}</version>
        <configuration>
        <strict>true</strict>
        <force>true</force>
        <!-- Enable during development to speed compiling. --> 
        <!-- <draftCompile>true</draftCompile>
        <style>DETAILED</style> -->
        <!--<userAgents>ie8</userAgents>--> 
        <!-- <userAgents>gecko1_8</userAgents> -->
        <!-- End development options -->
        <webappDirectory>src/main/webapp/VAADIN/widgetsets</webappDirectory>
          <modules>
            <module>o.p.c.p.ui.MyWidgetset</module>            
          </modules>
        </configuration>
      </plugin>

Then run vaadin:compile.

I also use the exec-maven-plugin to compile my style before packaging. We found that developers were forgetting to compile the final style before committing so we tied it to the package phase:

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
          <execution>
          <phase>prepare-package</phase>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>com.vaadin.sass.SassCompiler</mainClass>
          <arguments>
            <argument>src/main/webapp/VAADIN/themes/portalui/styles.scss</argument>
            <argument>src/main/webapp/VAADIN/themes/portalui/styles.css</argument>
          </arguments>
        </configuration>
      </plugin>
    </plugins>

Mmm, so that’s all covers all my questions, am I right? It seems great. I’ll try it and reply back wtih results.
Thank you a lot.

Artem,
One small observation, you state:

WEB-INF/VAADIN

This won’t work. At least not to access themes and other items. Widgetsets are (if you use Eclipse set up for Vaadin) automatically placed in the VAADIN/widgesets directory for you. If they’re not there, your app will definitely not work.

The correct file structure is:


WEBAPP/
   ------/WEB-INF
   ------/lib  <where JARs need to be>
   ------/VAADIN
   ------/META-INF
   ------/<any other directories you need>

Without the structure above, you cannot add or change themes. Load images, etc.

FYI images need to be in a theme and images are stored in /VAADIN//images. See
Tutorial
for more info on themes and images.


EDIT → It seems you are using Vaadin 7 given the jars list? My comments apply to Vaadin 6.x, not sure about 7.0+

Hope this helps.

Yes, I use Vaadin 7.0+ and there’s no /themes folder in the base app (from an archetype). That’s why such questions arose :slight_smile: