Vaadin Add-Ons from maven

Hi. Did anyone get vaadin add-ons running by defining them as a dependency in maven?

(Eclipse Galileo and m2eclipse)
For example, the superimmediatetextfield by Henrik. When adding it from the maven repo, it’s added as “pom”. After changing to “jar” it appears in the buildpath under “Maven Dependencies” (of course), but when compiling the widgetset, it’s not being included. What else needs to be done?

btw. @henrik, why did you choose “org.vaadin” instead of “com.vaadin”? That’s misleading :frowning:

It is strange it appears as a POM. I have used several server-side only add-ons from the directory, and did also test some client side ones a while back - did not run into such problems. There is also no custom POM in that add-on.

Are you compiling the widgetset with Maven, using e.g. “mvn clean gwt:clean vaadin:update-widgetset gwt:compile” (some redundancy in this command)?

I’ll try to remember to get back to testing this soon if nobody else has an idea.

See
the terms of service, point 21 about trademarks
. The package com.vaadin is reserved for Vaadin Ltd, whereas org.vaadin can be used freely in open source software.

Admittedly, this is not so easy to find…

Did you add the add-on as a dependency in maven? Not sure if I was clear: When compiling the widgetset, the add-on is not being included in the compilation. But if I put it into WEB-INF/lib manually, it is.

No, just “mvn vaadin:update-widgetset” (or the widgetset-compile-button of the vaadin-eclipse-plugin).

Ah okay, makes sense, thanks :slight_smile:

Works just fine for me without changes:

Created a new project from the vaadin-archetype-clean 1.3.3.
Uncommented the widgetset/GWT related lines in pom.xml and added the dependency to SITF by copying five lines from the directory.
Added a SITF component to the application.
Added the module name to the Vaadin Maven plugin configuration in pom.xml (alternatively, could have created an “empty” widgetset file).

      <plugin>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-maven-plugin</artifactId>
        <version>1.0.1</version>
        <executions>
          <execution>
            <configuration>
              <modules>
             	<module>org.vaadin.testsitf.TestSitfWidgetset</module>
              </modules>
            </configuration>
...

Added the widgetset init parameter to web.xml .
Ran (in Eclipse) the Maven goal vaadin:update-widgetset .
Ran (in Eclipse) the Maven goal gwt:compile .
Refreshed the project in Eclipse.
Ran (in Eclipse) the Maven goal jetty:run .

No problems seen, the widgetset contains the widget and it shows on the UI.
You could check if you have forgotten one of these steps, and maybe check that your configuration for various Maven plugins corresponds to that of the latest archetype versions.

That’s where I failed. I didn’t configure the module, nor I had a widgetset file. When creating the widgetset file, it works. But defining the module, doesn’t.

			<plugin>
				<groupId>com.vaadin</groupId>
				<artifactId>vaadin-maven-plugin</artifactId>
				<version>1.0.1</version>
				<executions>
					<execution>
						<configuration>
							<modules>
								<module>com.example.sc2.widgetset.Sc2Widgetset</module>
							</modules>
						</configuration>
					</execution>
				</executions>
			</plugin>

Gives:

[INFO]
 Scanning for projects...
[INFO]
 Searching repository for plugin with prefix: 'gwt'.
[INFO]
 ------------------------------------------------------------------------
[INFO]
 Building Unnamed - sc2:sc2:jar:0.0.1-SNAPSHOT
[INFO]
    task-segment: [vaadin:update-widgetset, gwt:compile]

[INFO]
 ------------------------------------------------------------------------
[INFO]
 [vaadin:update-widgetset {execution: default-cli}]

[WARNING]
 GWT plugin is configured to detect modules, but none were found.
[INFO]
 No widgetsets to update.
[INFO]
 To create a widgetset, define a non-existing module in your pom.xml .
[INFO]
 [gwt:compile {execution: default-cli}]

[INFO]
 using GWT jars from project dependencies : 2.0.3
[WARNING]
 GWT plugin is configured to detect modules, but none where found.
[INFO]
 establishing classpath list (scope = compile)
[INFO]
 ------------------------------------------------------------------------
[INFO]
 BUILD SUCCESSFUL
[INFO]
 ------------------------------------------------------------------------
[INFO]
 Total time: 6 seconds
[INFO]
 Finished at: Tue Oct 12 12:36:54 CEST 2010
[INFO]
 Final Memory: 13M/32M
[INFO]
 ------------------------------------------------------------------------

At least I get it working with the .gwt.xml file. But i still wonder why it doesn’t work with module defined.

Thanks for guidance!

If I remember correctly, you need to move the configuration out of the executions section.
The latest archetype versions should be correct, older versions had this part of the configuration nested too deep.

This will create project for Vaadin 6. Is there such example for Vaadin 7 ?

For Vaadin 7, use vaadin-archetype-widget for creating add-ons and vaadin-archetype-application for applications. See e.g.
Book of Vaadin
or various blog posts etc. for more information.