Vaadin and Maven
Remarks#
This would be very useful to the Vaadin and Maven community because there is no documentation
Vaadin Maven Setup
Common Maven
mvn -B archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin- archetype-application -DarchetypeVersion=7.7.3 -DgroupId=org.test -DartifactId=vaadin-app -Dversion=1.0-SNAPSHOT
Advanced Maven
mvn archetype:generate \
-DgroupId=com.mycompany.mycompanyapp \
-DartifactId=mycompanyapp \
-Dversion=1.0 \
-DpackageName=com.mycompany.mycompanyapp \
-DarchetypeGroupId=com.vaadin \
-DarchetypeArtifactId=vaadin-archetype-application \
-DthemeName=mytheme \
-DuiName=MyCompanyAppUI \
-DwidgetsetName=MyCompanyAppAppWidgetSet \
-DarchetypeVersion=LATEST \
-DinteractiveMode=false
After this is done, run following: cd ~/mycompanyapp && mvn install -Dmaven.skip.tests=true
Pom
-
Repositories
vaadin-addons https://maven.vaadin.com/vaadin-addons vaadin-snapshots Vaadin snapshot repository https://oss.sonatype.org/content/repositories/vaadin-snapshots true false vaadin-releases Vaadin releases https://oss.sonatype.org/content/repositories/vaadin-releases/ -
Properties
6.8-SNAPSHOT 2.3.0 -
Dependencies
com.vaadin vaadin-testbench 3.0.4 test com.vaadin.addon vaadin-touchkit-agpl 2.1.3 jar org.vaadin.vol openlayers-wrapper 1.2.0 com.vaadin vaadin ${vaadin.version} javax.servlet servlet-api 2.3 provided com.google.gwt gwt-user ${gwt.version} provided com.google.gwt gwt-dev ${gwt.version} provided org.jsoup jsoup 1.6.3 commons-io commons-io 2.4 org.vaadin.addons formbinder 2.0.0 org.eclipse.jetty jetty-servlets 8.1.7.v20120910 junit junit LATEST test -
Build
-
Plugins
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>2.3.0-1</version> <configuration> <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs> <!-- <runTarget>mobilemail</runTarget> --> <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This way compatible with Vaadin eclipse plugin. --> <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets </webappDirectory> <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets </hostedWebapp> <noServer>true</noServer> <!-- Remove draftCompile when project is ready --> <draftCompile>false</draftCompile> <compileReport>false</compileReport> <style>OBF</style> <runTarget>https://localhost:8080/</runTarget> </configuration> <executions> <execution> <goals> <goal>resources</goal> <goal>compile</goal> </goals> </execution> </executions> </plugin> <!-- As we are doing "inplace" GWT compilatio, ensure the widgetset --> <!-- directory is cleaned properly --> <plugin> <artifactId>maven-clean-plugin</artifactId> <version>2.4.1</version> <configuration> <filesets> <fileset> <directory>src/main/webapp/VAADIN/widgetsets</directory> </fileset> </filesets> </configuration> </plugin> <plugin> <groupId>com.vaadin</groupId> <artifactId>vaadin-maven-plugin</artifactId> <version>1.0.2</version> <executions> <execution> <configuration> <!-- if you don't specify any modules, the plugin will find them --> <!-- <modules> <module>com.vaadin.demo.mobilemail.gwt.ColorPickerWidgetSet</module> </modules> --> </configuration> <goals> <goal>update-widgetset</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.6.v20120903</version> <configuration> <systemProperties> <systemProperty> <name>jetty.port</name> <value>5678</value> </systemProperty> </systemProperties> </configuration> <executions> <!-- start and stop jetty (running our app) when running integration tests --> <execution> <id>start-jetty</id> <phase>pre-integration-test</phase> <goals> <goal>run-exploded</goal> </goals> <configuration> <scanIntervalSeconds>0</scanIntervalSeconds> <daemon>true</daemon> <stopKey>STOP</stopKey> <stopPort>8866</stopPort> </configuration> </execution> <execution> <id>stop-jetty</id> <phase>post-integration-test</phase> <goals> <goal>stop</goal> </goals> <configuration> <stopPort>8866</stopPort> <stopKey>STOP</stopKey> </configuration> </execution> </executions> </plugin>'
-