Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Using Maven with TouchKit?

Moritz Petersen
1 decade ago Apr 13, 2010 10:10am
Henri Sara
1 decade ago Apr 13, 2010 11:19am

Hi Moritz,

Moritz Petersen:
In my project, I use Maven and Vaadin TouchKit. But the WidgetSet compilation doesn't work. How can I do this?

I'm getting the following error message:

"Widgetset does not contain implementation for org.vaadin.touchkit.TouchPanel. Check its @ClientWidget mapping, widgetsets GWT module descrioption file and re-compile your widgetset. (...)"

I was following the instructions in http://vaadin.com/wiki/-/wiki/Main/Using%20Vaadin%20with%20Maven to setup my pom.xml.
Then I was using

> mvn clean vaadin:update-widgetset

But no success. I'm struggling with the compilation of the widgetset.

Do you mean that this goal fails or that it simply does not fix your original problem?

Moritz Petersen: Do I have to change anything in the pom.xml?
Which goal do I have to execute?

Normally, you should only need to add a dependency to the Vaadin TouchKit to your pom.xml dependencies section - no other change should be necessary.

Note that with Maven, you cannot simply copy a JAR to a project but you have to install it to your local maven repository and then add a dependency to it in your own pom.xml, e.g.

mvn install:install-file -Dfile=Vaadin_TouchKit_0.5.jar -DgroupId=com.vaadin -DartifactId=touchkit -Dversion=0.5 -packaging=jar -DgeneratePom=true

and

<dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>touchkit</artifactId>
            <version>0.5</version>
        </dependency>

You should then be able to execute the goals "gwt:clean vaadin:update-widgetset package".

Moritz Petersen:
The plugin definition in my pom.xml looks like this:

<plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>1.0.0</version>
            <executions>
                <execution>
                    <configuration>
                        <!-- if you don't specify any modules, the plugin will find them -->
                        <modules>
<!--
What to specify here?
                          <module>org.vaadin.touchkit.widgetset</module>
-->
                        </modules>
                    </configuration>
                    <goals>
                        <goal>update-widgetset</goal>
                   [Edit] I should mention that I'm using Maven to build my project.  </goals>
                </execution>
            </executions>
        </plugin>

This change should not be necessary, the modules are normally auto-detected. If you do want to specify the module yourself, it should at least point to your own widgetset GWT module (the .gwt.xml file without the extension) and possibly some additional modules you might need.

Moritz Petersen
1 decade ago Apr 13, 2010 12:35pm
Henri Sara
1 decade ago Apr 13, 2010 1:04pm

Moritz Petersen: And again,

>mvn gwt:clean vaadin:update-widgetset package

runs successfully, but gives the same warning message as above.

I'm using a standard Maven directory structure.

The point is, that I'm not using my own widgetset, but the Touchkit (well, of course you know that), and therefore I think that maybe the module doesn't get automatically detected because it is located in a JAR file....

The goal vaadin:update-widgetset should create a widgetset if it does not exist, and update it to refer to the sub-widgetsets in extension JARs etc. Maybe the widgetset is created in the wrong location in this case, e.g. some generated code directory.

The standard setup (when using your own custom widgets or ones from add-on JARs) is to have a widgetset in your own project that simply inherits the default widgetset and any add-on specific ones.

You could try to create an empty widgetset by hand, and see if it gets correctly updated by the goal vaadin:update-widgetset after creation, or even set it up completely by hand - here is an example of how the widgetset (e.g. com/example/MyWidgetSet.gwt.xml) could look like for the TouchKit:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
	<inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />
        <!-- This comes from the MANIFEST.MF of the TouchKit JAR -->
	<inherits name="org.vaadin.touchkit.widgetset.TouchKitWidgetset" />
</module>

Then run the goals "gwt:clean package".

Moritz Petersen
1 decade ago Apr 13, 2010 2:44pm
Moritz Petersen
1 decade ago Apr 13, 2010 3:41pm
Artur Signell
1 decade ago Apr 13, 2010 4:06pm

The errors in the earlier post are because you were using the wrong (old) GWT version. The new "errors" are actually not errors but text output to stderr, which maven prefixes with [ERROR]. If there are no other "errors" than the list of the widgets included, it should work.

Moritz Petersen
1 decade ago Apr 13, 2010 4:44pm
Moritz Petersen
1 decade ago Apr 13, 2010 4:58pm
Moritz Petersen
1 decade ago Apr 18, 2010 8:36pm
Moritz Petersen
1 decade ago Apr 20, 2010 7:34am