Vaadin is a fancy JAVA Ajax Web Framework. I had some troubles setting up maven2, thats why I created a quick howto:
1) Download and install Vaadin Add-on’s
Get the Google Map Add-on from the Vaadin Directory and expand the .zip file. Install the package into your repo, for example:
1 2 | mvn install:install-file -Dfile=googlemapwidget-0.9.3.jar -DgroupId=org.vaadin.hezamu -DartifactId=googlemapwidget -Dpackaging=jar -Dversion=0.9.3 mvn install:install-file -Dfile=gwt-maps.jar -DgroupId=com.google.gwt.maps -DartifactId=gwt-maps -Dpackaging=jar -Dversion=1.0.4 |
2) Create a new maven project
Create a new sample project, for more information check out the Wiki.
1 | mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-sample -DarchetypeVersion=LATEST -DgroupId=com.neophob -DartifactId=project-name -Dversion=1.0 -Dpackaging=war |
Check http://mvnrepository.com/artifact/com.vaadin/vaadin-archetype-sample for the latest vaadin archetype!
3) Edit pom.xml
Make sure the gwt-maven-plugin use at least the 1.3-SNAPSHOT version. The next step is to add the Add-on dependencies:
1 2 3 4 5 6 7 8 9 10 | <dependency> <groupId>com.google.gwt.maps</groupId> <artifactId>gwt-maps</artifactId> <version>1.0.4</version> </dependency> <dependency> <groupId>org.vaadin.hezamu</groupId> <artifactId>googlemapwidget</artifactId> <version>0.9.3</version> </dependency> |
4) Copy GWT declarations
Copy the files GooglemapwidgetWidgetset.gwt.xml, AjaxLoader.gwt.xml and GoogleMaps.gwt.xml (those xml files are inside the plugin jar file) to the srcmainjavacomneophobgwt directory.
5) Declare Widgetset
Edit web.xml, add reference to Widgets:
1 2 3 4 5 6 7 8 9 10 11 | <servlet> ... <init-param> <param-name>widgetset</param-name> <param-value>com.neophob.gwt.GoogleMaps</param-value> </init-param> <init-param> <param-name>widgetset</param-name> <param-value>com.neophob.gwt.GooglemapwidgetWidgetset</param-value> </init-param> </servlet> |
6) Create Simple Class
Edit ColorPickerAppliaction.java, replace the it with this content:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | package com.neophob; import java.awt.geom.Point2D; import org.vaadin.hezamu.googlemapwidget.GoogleMap; import org.vaadin.hezamu.googlemapwidget.overlay.BasicMarker; import com.vaadin.ui.Label; import com.vaadin.ui.Window; public class ColorPickerApplication extends com.vaadin.Application { @Override public void init() { Window mainWindow = new Window("Example_ide Application"); Label label = new Label("Hello Vaadin uservvvv"); mainWindow.addComponent(label); setMainWindow(mainWindow); // Create a new map instance centered on the IT Mill offices GoogleMap googleMap = new GoogleMap(this, new Point2D.Double(22.3, 60.4522), 8); googleMap.setWidth("640px"); googleMap.setHeight("480px"); // Create a marker at the IT Mill offices googleMap.addMarker(new BasicMarker(1L, new Point2D.Double(22.3, 60.4522), "Test marker")); mainWindow.addComponent(googleMap); } } |
7) Run Jetty
1 | > mvn jetty:run |
Fire up your browser:
Other usefulll maven targets:
1 2 3 4 | update widgetsets: # mvn vaadin:update-widgetset recreate javascript: # mvn gwt:clean gwt:compile |



