I have created a vaadin web application using maven in eclipse
. In particular I have used the archetype vaadin-archetype-touchkit
as described in t
here is the readme in the root of the project
To compile the entire project, run "mvn install". To run the application, run "mvn jetty:run" and open http://localhost:8080/ .
To develop the theme, simply update the relevant theme files and reload the application. Pre-compiling a theme eliminates automatic theme updates at runtime - see below for more information.
Debugging client side code - run "mvn vaadin:run-codeserver" on a separate console while the application is running - activate Super Dev Mode in the debug window of the application
To produce a deployable production mode WAR: - change productionMode to true in the servlet class configuration (nested in the UI class) - run "mvn clean vaadin:compile-theme package" - See below for more information. Running "mvn clean" removes the pre-compiled theme. - test with "mvn jetty:run-war
follow the instruction and you will get the correct page : )
For me, adding the following to pom.xml
helped:
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
<version>${vaadin.version}</version>
</dependency>
The web.xml is no longer needed only if you use servlet 3.0 configuration (annotating your servlet as described 4.8.3. WEB Servlet Class)
Usually you'd configure your Vaadin 3.0 Servlet Config in this way:
public class MyUI extends UI {
@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = MyUI.class)
public static class Servlet extends VaadinServlet {
}
@Override
protected void init(VaadinRequest request) {
//your init stuff here
}
}
Where using the @VaadinServletConfiguration as shortcut for setting vaadin-related params.
Now, if you have no vaadin addon in your project (so you're using the default widgetset), that's it, no more work is required.
Instead, if you're using custom addons, you must specify which widgetset to use in the @VaadinServletConfiguration
simply by adding the widgetset parameter in this way
public class MyUI extends UI {
@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(widgetset="com.bla.bla.MyWidgetSet",productionMode = false, ui = MyUI.class)
public static class Servlet extends VaadinServlet {
}
@Override
protected void init(VaadinRequest request) {
//your init stuff here
}
}
Otherwise you must create the web.xml manually as usual...
When it comes to maven, I think you've just to run mvn clean package and on the package phase the maven-vaadin-plugin will compile you're widgetset automatically.