Using Vaadin with Maven 2

I got the add-on working easily without maven and with the eclipse-vaadin plugin, and i can see now where it goes wrong with maven. This is what i found:

Calling gwt-maven-plugin:compile will compile the widgetset, but the result will be in the wrong location. Actually it will be in 2 wrong locations. As far as i can tell the widgetset stuff is supposed to end up in the VAADIN/widgetsets directory which should be directly adjecant to WEB-INF and META-INF.

In the maven project the 0E0E544EC6599E266957ECAC00238233.cache.html files end up in their own directory, like so:
\META-INF
\myproject.gwt.VisualisationsForVaadin (all the blabla.cache.html files)
\VAADIN (the themes are here but the widgetset not)
\WEB-INF

The rest of the VisualisationsForVaadin widgetset stuff is written to an ‘extra’ folder directly in the build directory, outside of, and on the same level as the project’s build. The resulting target directory looks like:
\extra
…\myproject.gwt.VisualisationsForVaadin
…\ rpcPolicyManifest
…\ soycReport
…\symbolMaps
\myproject
…\META-INF
…\myproject.gwt.VisualisationsForVaadin
…\VAADIN
…\WEB-INF
\

Hi. I’m trying to upgrade to Vaadin 6.5.4 with Maven 2 integration, to do that I’m using the maven plugins:

groupId:
org.codehaus.mojo

artifactId:
gwt-maven-plugin

version:
2.1.0-1

groupId:
com.vaadin

artifactId:
vaadin-maven-plugin

version:
1.0.1

And I’m importing the 2.1.1
gwt-user
version.

The problem is when I build my project with maven, because the console indicates everything is fine, but some maven plugin is not finding the DefaultWidgetset of Vaadin, and for that reason my package does not contain the default widgets; causing my application to display empty portlets.

I noticed too that on my MyWidgetSet.gwt.xml file, the plugin removes the line:

<inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />

but i’m importing two other addons which are defined on MyWidgetSet.gwt.xml file explicitly, and those are found by maven when compiling, but not the DefaultWidgetset of Vaadin:


[INFO]
 [gwt:compile {execution: default}]

[INFO]
 auto discovered modules [com.example.widgetset.MyWidgetSet]

[INFO]
 Compiling module com.example.widgetset.MyWidgetSet
[INFO]
    Scanning for additional dependencies:  /.m2/repository/com/vaadin/vaadin/6.5.4.1/vaadin-6.5.4.1.jar!/com/vaadin/terminal/gwt/client/WidgetSet.java
[INFO]
       Computing all possible rebind results for 'com.vaadin.terminal.gwt.client.WidgetMap'
[INFO]
          Rebinding com.vaadin.terminal.gwt.client.WidgetMap
[INFO]
             Invoking generator com.vaadin.terminal.gwt.widgetsetutils.EagerWidgetMapGenerator
[INFO]
                Detecting Vaadin components in classpath to generate WidgetMapImpl.java ...
[ERROR]
 31/03/2011 06:10:31 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getPaintablesHavingWidgetAnnotation
[ERROR]
 INFO: Searching for paintables..
[ERROR]
 [INFO]
                Widget set will contain implementations for following components:
[INFO]
                  org.vaadin.addthis.AddThis
31/03/2011 06:10:32 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getPaintablesHavingWidgetAnnotation
[INFO]
                  org.vaadin.hene.popupbutton.PopupButton
[ERROR]
 INFO: Search took 1648ms
[INFO]
                Done. (2seconds)
[INFO]
    Compiling 5 permutations
[INFO]
       Compiling permutation 2...
[INFO]
       Process output
[INFO]
          Compiling
[INFO]
             Compiling permutation 3...
[INFO]
       Process output
[INFO]
          Compiling
[INFO]
             Compiling permutation 4...
[INFO]
       Process output
[INFO]
          Compiling
[INFO]
             Compiling permutation 1...
[INFO]
       Process output
[INFO]
          Compiling
[INFO]
             Compiling permutation 0...
[INFO]
    Compile of permutations succeeded

So anyone have some idea what’s happening, or what i’m setting wrong on my config? I will appreciate any ideas or comment about that.

Obviously the DefaultWidgetSet is not found when scanning the classpath, including JARs on the classpath that have the Vaadin widgetset related fields in their manifests etc.

Did you check whether your Vaadin JAR (in your Maven local repository - see the path above) contains the default widgetset or not? Is its manifest correct, and the first entry in the JAR? It certainly should, at least if it is the standard JAR, but I wonder about the 6.5.4.1 as the version number - the published version in Maven Central has the version number 6.5.4.

I also assume you have copied the configuration of the plugins you mentioned e.g. from a new version of one of the standard archetypes.

Also check the scope of your dependency to the Vaadin JAR - although I don’t think it would be the cause here.

Hi All,

I could not get to run Vaadin with Maven as suggested both on book of Vaadin and wiki (https://vaadin.com/wiki/-/wiki/Main/Using%20Vaadin%20with%20Maven)


[INFO]
 Archetype repository missing. Using the one from [com.vaadin:vaadin-archetype-clean:1.6.1]
 found in catalog remote
[INFO]
 ------------------------------------------------------------------------
[ERROR]
 BUILD FAILURE
[INFO]
 ------------------------------------------------------------------------
[INFO]
 : org.apache.maven.archetype.exception.UnknownArchetype: The desired archetype does not exist (com.vaadin:vaadin-archetype-clean:LATEST)
The desired archetype does not exist (com.vaadin:vaadin-archetype-clean:LATEST)
[INFO]
 ------------------------------------------------------------------------

After some googling around and a few hours later I reached the conclusion that Maven central is not used for archetype repository anymore.

So I had to add " -DarchetypeRepository=http://repo1.maven.org/maven2 " to get it working.