Vaadin Maven - Custom GWT Procedure

Good day, everyone!

I would like to ask for directions or a tutorial on how to properly create and integrate a custom gwt widget.
What is the proper way in creating of creating a custom widget?
Should I create a separate project using the GWT sdk
should I just use Vaadin’s way of creating a custom component?

I tried following Vaadin’s tutorial on simple components, problem is the pom configuration, I can’t seem to properly configure it to integrate the creation of gwt.

I also tried to follow the integration of an existing gwt component from:
Where you have to download a jar from gwt g-flot and put it in the projects web-inf folder.
And the problem is, in my Maven setup, there is no web-inf folder, since the libraries are acquired through the pom and will be automatically packaged with the project instead of putting it manually.

Any advice? Thanks!


I recommend trying this GWT widget archetype: - It’s self-contained and quite easy to develop with.


Okay, so what I will do is add this as a separate module in a multi-module maven project? And then just add it as a dependency for my Vaadin Project?
Is that right?


You might want to create a separate projects eventually (one for demo / development that’s not included in release and one for the widget only), but yeah.


Okay, got it! Thanks!

Is it possible to attach an external gwt plugin in the maven dependency to the project??
I’m trying to add this dependency:

But an error occurs:

No source code is available for type com.allen-sauer.gwt.dnd did you forget to inherit a required module?

Is it possible to do so??

That’s a GWT error. Did you include the included module in your .gwt.xml file? See for some extra information as well.


I did try to include it in the .gwt.xml file.
The error doesn’t occur on the project module of the addon itself, it occurs in the project where I add the addon as a dependency too.

There’s an error when I’m trying to compile the widgetset too in the addon, its this: GWT Module com.allen-sauer.gwt.dnd not found in project sources or resources.
I have the dependency in my pom.xml:

<!-- -->

And added it to my Widgetsets.gwt.xml by: <inherits name="com.allen-sauer.gwt.dnd" />

One idea: try adding another copy of the dependency with

<classifier>sources</classifier> as GWT compilation requires also the source code of the client side modules to be available, and not all add-ons include it in the main JAR.

Okay, so it should be like this?

EDIT 2 : - changed error
Just tried the above, still doesn't work. 
    Loading inherited module 'com.allen-sauer.gwt.dnd'
 Invalid module name: 'com.allen-sauer.gwt.dnd'

Widgetset is:[code]
<!-- WS Compiler: manually edited -->
<inherits name="com.vaadin.DefaultWidgetSet" />
<inherits name="com.allen-sauer.gwt.dnd" />
<set-configuration-property name="devModeRedirectEnabled" value="true" />
<source path="client/"></source>

And on the pom of the project, its: <dependency> <groupId>com.allen-sauer.gwt.dnd</groupId> <artifactId>gwt-dnd</artifactId> <version>3.3.4</version> </dependency> <dependency> <groupId>com.allen-sauer.gwt.dnd</groupId> <artifactId>gwt-dnd</artifactId> <version>3.3.4</version> <classifier>sources</classifier> </dependency> I placed two dependencies, one with the classifier, still a no go.

At least according to
the module to inherit should use underscore instead of dash in the package path part:

<inherits name='com.allen_sauer.gwt.dnd.gwt-dnd'/>

Yup. This fixes it.