title: Breaking out Vaadin widgetset compilation
body: <p>In order to save time compiling, I'm trying to break out the compilation of the widgetsets to a TeamCity build project of its own, we're using nexus as repo. The Vaadin "base project" is then to contain a dependency to the widgetset artifact to fetch the current version. I'm sure this has been done before.</p>
  
  <p>The widgetset project builds fine in TeamCity. The jars and poms are correctly uploaded to nexus. I have unpacked the jars to make sure everything was in its place. So far so good.</p>
  
  <p>In eclipse, the base project does fetch the widgetset artifact and contain it in its library. Seems good.</p>
  
  <p>However, when I do a "mvn clean package" on the base project from eclipse and run it on Tomcat, I get the following error in the web browser:</p>
  
  <pre><code>Failed to load the widgetset: ./VAADIN/widgetsets/com.example.somerandomapp.web.AppWidgetSet/com.example.somerandomapp.web.AppWidgetSet.nocache.js?1376642850734
  </code></pre>
  
  <p>When I check the project structure, I find no VAADIN/widgetset-folder under the target folder. Additionally, in the maven dependency jar-file, there are one VAADIN folder containing gwt-unitCache and one VAADIN.widgetsets-folder containing the widgetset-goodies, as well as the - in the error message above - mentioned file.</p>
  
  <p>I cannot get my head around this. I'm no maven pro, so I may have missed something trivial there. Also I'm no Vaadin pro, so I might as well have missed something just as trivial there.</p>
  
  <p>I really hope there is someone out there that could help me get this ship in the water. I would greatly appreciate it!</p>
  
  <p>Vaadin version: 7.1.1
  Maven version: 3.0.4</p>
  
  <p>My base project's pom.xml (leaving out some stuff for brevity):</p>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;dependencies&gt;
  
      &lt;!-- Some Random App - Commons --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.example.somerandomapp.common&lt;/groupId&gt;
          &lt;artifactId&gt;somerandomapp-common-widgetset&lt;/artifactId&gt;
          &lt;version&gt;0.0.5-SNAPSHOT&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Vaadin --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
          &lt;artifactId&gt;vaadin-server&lt;/artifactId&gt;
          &lt;version&gt;${vaadin.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
          &lt;artifactId&gt;vaadin-client-compiled&lt;/artifactId&gt;
          &lt;version&gt;${vaadin.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
          &lt;artifactId&gt;vaadin-client&lt;/artifactId&gt;
          &lt;version&gt;${vaadin.version}&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
          &lt;artifactId&gt;vaadin-push&lt;/artifactId&gt;
          &lt;version&gt;${vaadin.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
          &lt;artifactId&gt;vaadin-themes&lt;/artifactId&gt;
          &lt;version&gt;${vaadin.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
          &lt;version&gt;${javax-servlet-api.version}&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
              &lt;version&gt;${maven-war-plugin.version}&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>My widgetset-pom (leaving out some stuff for brevity):</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;!-- same Vaadin-plugins as in the "base project" --&gt;
  &lt;!-- maven compiler, release, javadoc, deploy and source artifacts --&gt;
      &lt;plugin&gt;
          &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
          &lt;version&gt;${maven-clean-plugin.version}&lt;/version&gt;
          &lt;configuration&gt;
              &lt;filesets&gt;
                  &lt;fileset&gt;
                      &lt;directory&gt;src/main/webapp/VAADIN/widgetsets&lt;/directory&gt;
                  &lt;/fileset&gt;
              &lt;/filesets&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
  
      &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
          &lt;version&gt;${maven-jar-plugin.version}&lt;/version&gt;
          &lt;configuration&gt;
              &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
              &lt;excludes&gt;
                  &lt;exclude&gt;VAADIN/widgetsets/WEB-INF/**&lt;/exclude&gt;
              &lt;/excludes&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
  
      &lt;plugin&gt;
          &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
          &lt;artifactId&gt;vaadin-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;${vaadin-plugin.version}&lt;/version&gt;
          &lt;configuration&gt;
              &lt;extraJvmArgs&gt;-Xmx512M -Xss1024k&lt;/extraJvmArgs&gt;
              &lt;!-- &lt;runTarget&gt;mobilemail&lt;/runTarget&gt; --&gt;
              &lt;!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This 
                   way compatible with Vaadin eclipse plugin. --&gt;
              &lt;webappDirectory&gt;${project.build.outputDirectory}/VAADIN/widgetsets&lt;/webappDirectory&gt;
              &lt;hostedWebapp&gt;${project.build.outputDirectory}/VAADIN/widgetsets&lt;/hostedWebapp&gt;
              &lt;noServer&gt;true&lt;/noServer&gt;
              &lt;!-- Remove draftCompile when project is ready --&gt;
              &lt;draftCompile&gt;false&lt;/draftCompile&gt;
              &lt;compileReport&gt;true&lt;/compileReport&gt;
              &lt;style&gt;OBF&lt;/style&gt;
              &lt;strict&gt;true&lt;/strict&gt;
              &lt;runTarget&gt;http://localhost:8080/&lt;/runTarget&gt;
          &lt;/configuration&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;goals&gt;
                     &lt;goal&gt;clean&lt;/goal&gt;
                      &lt;goal&gt;resources&lt;/goal&gt;
                      &lt;goal&gt;update-theme&lt;/goal&gt;
                      &lt;goal&gt;update-widgetset&lt;/goal&gt;
                      &lt;goal&gt;compile-theme&lt;/goal&gt;
                      &lt;goal&gt;compile&lt;/goal&gt;
                  &lt;/goals&gt;
              &lt;/execution&gt;
          &lt;/executions&gt;
      &lt;/plugin&gt;
  &lt;/plugins&gt;
  &lt;pluginManagement&gt;
      &lt;plugins&gt;    
          &lt;!--This plugin's configuration is used to store Eclipse m2e settings 
              only. It has no influence on the Maven build itself. --&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.eclipse.m2e&lt;/groupId&gt;
              &lt;artifactId&gt;lifecycle-mapping&lt;/artifactId&gt;
              &lt;version&gt;1.0.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;lifecycleMappingMetadata&gt;
                      &lt;pluginExecutions&gt;
                          &lt;pluginExecution&gt;
                              &lt;pluginExecutionFilter&gt;
                                  &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
                                  &lt;artifactId&gt;vaadin-maven-plugin&lt;/artifactId&gt;
                                  &lt;versionRange&gt;[7.1.1,)&lt;/versionRange&gt;
                                  &lt;goals&gt;
                                      &lt;goal&gt;update-theme&lt;/goal&gt;
                                      &lt;goal&gt;resources&lt;/goal&gt;
                                      &lt;goal&gt;compile-theme&lt;/goal&gt;
                                      &lt;goal&gt;update-widgetset&lt;/goal&gt;
                                  &lt;/goals&gt;
                              &lt;/pluginExecutionFilter&gt;
                              &lt;action&gt;
                                  &lt;ignore /&gt;
                              &lt;/action&gt;
                          &lt;/pluginExecution&gt;
                      &lt;/pluginExecutions&gt;
                  &lt;/lifecycleMappingMetadata&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/pluginManagement&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p><strong>Update:</strong>
  I have setup my MainUI class like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>@WebServlet(value = {"/foo/*", "/VAADIN/*"} , asyncSupported = true)
  @VaadinServletConfiguration(productionMode = false, ui = MainUI.class, widgetset = "com.example.somerandomapp.common.widgetset.AppWidgetSet")
  </code></pre>
  
  <p>I realised this has something to do with it and changed it to the correct widgetset. But I still get the same error:</p>
  
  <pre class="lang-xml prettyprint-override"><code>Failed to load the widgetset: ./VAADIN/widgetsets/com.example.somerandomapp.common.widgetset.AppWidgetSet/com.example.somerandomapp.common.widgetset.AppWidgetSet.nocache.js?1376662202437
  </code></pre>
  
  <p>Now, this error shows the correct path to the nocache-file in the classpath, which makes me very confused, because the file is there, in the lib folder.
  I hope this didn't confuse you further....</p>
  
  <p><strong>Update 2:</strong>
  Actually this is adequate:</p>
  
  <pre class="lang-xml prettyprint-override"><code>@WebServlet(value = "/*", asyncSupported = true)
  @VaadinServletConfiguration(productionMode = false, ui = MainUI.class, widgetset = "com.example.somerandomapp.common.widgetset.AppWidgetSet")
  </code></pre>