Calendar addon with Maven

I’m trying to set up a simple test app using Calendar addon with Maven but I’m not having any luck. I can compile the widgetset just fine, but the rest of the build doesn’t work. I’ve tried everything mentioned in
this thread
, such as different versions of Vaadin/GWT but nothing seems to work.

This is my output for mvn vaadin:update-widgetset gwt:compile


Scanning for projects...
[WARNING]
 
[WARNING]
 Some problems were encountered while building the effective model for com.mitre:VaadinGCal:war:1.0
[WARNING]
 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 17, column 15
[WARNING]
 
[WARNING]
 It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
 
[WARNING]
 For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
 
                                                                        
------------------------------------------------------------------------
Building Vaadin Web Application 1.0
------------------------------------------------------------------------

--- vaadin-maven-plugin:1.0.1:update-widgetset (default-cli) @ VaadinGCal ---
[WARNING]
 GWT plugin is configured to detect modules, but none were found.
No widgetsets to update.
To create a widgetset, define a non-existing module in your pom.xml .

--- gwt-maven-plugin:1.3-SNAPSHOT:compile (default-cli) @ VaadinGCal ---
using GWT jars from project dependencies : 2.0.4
establishing classpath list (scope = compile)
establishing classpath list (scope = compile)
establishing classpath list (scope = compile)
Compiling module com.vaadin.addon.calendar.gwt.CalendarWidgetset
   Scanning for additional dependencies: jar:file:/C:/Documents%20and%20Settings/molenik/.m2/repository/com/vaadin/vaadin/6.4.7/vaadin-6.4.7.jar!/com/vaadin/terminal/gwt/client/WidgetSet.java
      Computing all possible rebind results for 'com.vaadin.terminal.gwt.client.WidgetMap'
         Rebinding com.vaadin.terminal.gwt.client.WidgetMap
            Invoking com.google.gwt.dev.javac.StandardGeneratorContext@1f0b146
               Detecting Vaadin components in classpath to generate WidgetMapImpl.java ...
               Widget set will contain implementations for following components: 
                       com.vaadin.addon.calendar.ui.Calendar
                       com.vaadin.ui.AbsoluteLayout
                       com.vaadin.ui.Accordion
                       com.vaadin.ui.Button
                       com.vaadin.ui.CheckBox
                       com.vaadin.ui.ComboBox
                       com.vaadin.ui.CssLayout
                       com.vaadin.ui.CustomComponent
                       com.vaadin.ui.CustomLayout
                       com.vaadin.ui.DateField
                       com.vaadin.ui.DragAndDropWrapper
                       com.vaadin.ui.Embedded
                       com.vaadin.ui.Form
                       com.vaadin.ui.FormLayout
                       com.vaadin.ui.GridLayout
                       com.vaadin.ui.HorizontalLayout
                       com.vaadin.ui.Label
                       com.vaadin.ui.Link
                       com.vaadin.ui.ListSelect
                       com.vaadin.ui.MenuBar
                       com.vaadin.ui.NativeButton
                       com.vaadin.ui.NativeSelect
                       com.vaadin.ui.OptionGroup
                       com.vaadin.ui.OrderedLayout
                       com.vaadin.ui.Panel
                       com.vaadin.ui.PopupView
                       com.vaadin.ui.ProgressIndicator
                       com.vaadin.ui.RichTextArea
                       com.vaadin.ui.Select
                       com.vaadin.ui.Slider
                       com.vaadin.ui.SplitPanel
                       com.vaadin.ui.TabSheet
                       com.vaadin.ui.Table
                       com.vaadin.ui.TextField
                       com.vaadin.ui.Tree
                       com.vaadin.ui.TwinColSelect
                       com.vaadin.ui.Upload
                       com.vaadin.ui.UriFragmentUtility
                       com.vaadin.ui.VerticalLayout
                       com.vaadin.ui.Window
               Done. (0seconds)
   Scanning for additional dependencies: jar:file:/C:/Documents%20and%20Settings/molenik/.m2/repository/com/vaadin/vaadin/6.4.7/vaadin-6.4.7.jar!/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriteria.java
      Computing all possible rebind results for 'com.vaadin.terminal.gwt.client.ui.dd.VAcceptCriterionFactory'
         Rebinding com.vaadin.terminal.gwt.client.ui.dd.VAcceptCriterionFactory
            Invoking com.google.gwt.dev.javac.StandardGeneratorContext@1f0b146
               Detecting available criteria ...
               creating mapping for com.vaadin.ui.Tree.TreeDropCriterion
               creating mapping for com.vaadin.event.dd.acceptcriteria.AcceptAll
               creating mapping for com.vaadin.event.dd.acceptcriteria.TargetDetailIs
               creating mapping for com.vaadin.ui.Table.TableDropCriterion
               creating mapping for com.vaadin.ui.AbstractSelect.TargetItemIs
               creating mapping for com.vaadin.event.dd.acceptcriteria.SourceIsTarget
               creating mapping for com.vaadin.event.dd.acceptcriteria.SourceIs
               creating mapping for com.vaadin.ui.AbstractSelect.AcceptItem
               creating mapping for com.vaadin.event.dd.acceptcriteria.ContainsDataFlavor
               creating mapping for com.vaadin.event.dd.acceptcriteria.Not
               creating mapping for com.vaadin.event.dd.acceptcriteria.And
               creating mapping for com.vaadin.event.dd.acceptcriteria.Or
               creating mapping for com.vaadin.ui.Tree.TargetInSubtree
               creating mapping for com.vaadin.event.dd.acceptcriteria.ServerSideCriterion
               Done. (0seconds)
   Compiling 6 permutations
      Compiling permutation 1...
      Process output
         Compiling permutation 3...
      Process output
         Compiling permutation 2...
      Process output
         Compiling permutation 0...
         Compiling permutation 4...
         Compiling permutation 5...
   Compile of permutations succeeded
Linking into C:\Development\VaadinGCal\target\VaadinGCal-1.0\VAADIN\widgetsets\com.vaadin.addon.calendar.gwt.CalendarWidgetset.
   Link succeeded
   Compilation succeeded -- 40.276s
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 41.965s
Finished at: Mon Nov 01 15:20:12 EDT 2010
Final Memory: 3M/15M
------------------------------------------------------------------------

The output of mvn install


Scanning for projects...
[WARNING]
 
[WARNING]
 Some problems were encountered while building the effective model for com.mitre:VaadinGCal:war:1.0
[WARNING]
 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 17, column 15
[WARNING]
 
[WARNING]
 It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
 
[WARNING]
 For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
 
                                                                        
------------------------------------------------------------------------
Building Vaadin Web Application 1.0
------------------------------------------------------------------------

--- maven-resources-plugin:2.4.3:resources (default-resources) @ VaadinGCal ---
Using 'UTF-8' encoding to copy filtered resources.
Copying 0 resource

--- gwt-maven-plugin:1.3-SNAPSHOT:resources (default) @ VaadinGCal ---
establishing classpath list (scope = compile)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 0.891s
Finished at: Mon Nov 01 15:22:00 EDT 2010
Final Memory: 4M/15M
------------------------------------------------------------------------
[ERROR]
Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:1.3-SNAPSHOT:resources (default) on project VaadinGCal: GWT Module com.vaadin.addon.calendar.gwt.CalendarWidgetset not found in project sources or resources. -> [Help 1]

[ERROR]

[ERROR]
To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR]
Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

[ERROR]
For more information about the errors and possible solutions, please read the following articles:
[ERROR]
[Help 1]
 http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

And my pom.xml


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mitre</groupId>
  <artifactId>VaadinGCal</artifactId>
  <packaging>war</packaging>
  <version>1.0</version>
  <name>Vaadin Web Application</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>

      <!-- Compile custom GWT components or widget dependencies with the GWT compiler -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>1.3-SNAPSHOT</version>
        <configuration>
          <webappDirectory>${project.build.directory}/${project.build.finalName}/VAADIN/widgetsets</webappDirectory>
          <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
          <runTarget>VaadinGCal</runTarget>
          <hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
          <noServer>true</noServer>
          <port>8080</port>
          <soyc>false</soyc>
		  <modules>
			<module>com.vaadin.addon.calendar.gwt.CalendarWidgetset</module>
		  </modules>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>resources</goal>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin> 
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-maven-plugin</artifactId>
        <version>1.0.1</version>
        <executions>
          <execution>
		    <configuration>
			  <modules>
			    <module>com.vaadin.addon.calendar.gwt.CalendarWidgetset</module>
			  </modules>
		    </configuration>
            <goals>
              <goal>update-widgetset</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- A simple Jetty test server at http://localhost:8080/VaadinGCal can be launched with the Maven goal jetty:run 
        and stopped with jetty:stop -->
      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <version>6.1.24</version>
        <configuration>
          <stopPort>9966</stopPort>
          <stopKey>VaadinGCal</stopKey>
          <!-- Redeploy every x seconds if changes are detected, 0 for no automatic redeployment -->
          <scanIntervalSeconds>0</scanIntervalSeconds>
          <!-- make sure Jetty also finds the widgetset -->
          <webAppConfig>
            <contextPath>/VaadinGCal</contextPath>
            <baseResource implementation="org.mortbay.resource.ResourceCollection">
              <!-- Workaround for Maven/Jetty issue http://jira.codehaus.org/browse/JETTY-680 -->
              <!-- <resources>src/main/webapp,${project.build.directory}/${project.build.finalName}</resources> -->
              <resourcesAsCSV>src/main/webapp,${project.build.directory}/${project.build.finalName}</resourcesAsCSV>
            </baseResource>
          </webAppConfig>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <repositories>
	<repository>
	  <id>mandubian-mvn</id>
	  <url>http://mandubian-mvn.googlecode.com/svn/trunk/mandubian-mvn/repository</url>
	</repository>
    <repository>
      <id>vaadin-snapshots</id>
      <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>vaadin-addons</id>
      <url>http://maven.vaadin.com/vaadin-addons</url>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>codehaus-snapshots</id>
      <url>http://nexus.codehaus.org/snapshots</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </pluginRepository>
    <pluginRepository>
      <id>vaadin-snapshots</id>
      <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </pluginRepository>
  </pluginRepositories>

  <dependencies>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin</artifactId>
      <version>6.4.7</version>
    </dependency>
    <dependency>
      <groupId>com.google.gdata</groupId>
	  <artifactId>gdata-core-1.0</artifactId>
	  <version>1.41.5</version>
	</dependency>
	<dependency>
      <groupId>com.google.gdata</groupId>
	  <artifactId>gdata-calendar-2.0</artifactId>
	  <version>1.41.5</version>
	</dependency>
	<dependency>
	  <groupId>org.vaadin.addons</groupId>
	  <artifactId>vaadin-calendar</artifactId>
	  <version>1.0.0</version>
	</dependency>
    <!-- This is also used by gwt-maven-plugin to deduce GWT version number. -->
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>2.0.4</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>

Any clue what’s going on here? I’ve been looking everywhere and can’t seem to find a solution to this.

You should not be compiling the widgetset included in the calendar add-on, but your own widgetset that inherits it and any other add-on widgetsets you might want to use.

Use your own widgetset name in your own package hierarchy, including it in your pom.xml . Then run mvn vaadin:update-widgetset and it should automatically create the widgetset - or create an “empty” widgetset from a template such as
the example given in the book
and then rerun mvn vaadin:update-widgetset if it for some reason (usually a classpath order issue) does not create one.

I’m not sure if you need to move the configuration of the vaadin-maven-plugin out of the executions section or not for the automatic creation to work.

For more information, see also
these instructions for using add-ons
.