I am a new user of Vaadin, and I would like to know how I can compile my widget.
The main problem, is that I am not using my project as an Vaadin project (in eclipse) but as a
normal maven project.
I have a main which instanciate a Grizzly container like that :
public static void main(String args[])
{
GrizzlyWebServer grizzly = new GrizzlyWebServer(18081);
ServletAdapter sa = new ServletAdapter();
sa.setServletInstance(new com.vaadin.terminal.gwt.server.ApplicationServlet());
sa.addContextParameter("productionMode", "false");
sa.setContextPath("/");
sa.setProperty(ServletAdapter.LOAD_ON_STARTUP, "1");
sa.addInitParameter("application", FIVApplication.class.getName());
grizzly.addGrizzlyAdapter(sa, new String[]
{
"/", "/VAADIN"
});
FIVPersistenceHelper.getInstance().init();
try
{
grizzly.start();
}
catch(IOException e)
{
e.printStackTrace();
}
}
This is really powerfull, as I can embed my application in any normal java application.
The problem, is that eclipse don’t auto detect the fact I have added an addon (refresher), and I didn’t succeed to use the
mvn vaadin:update-widgset install .
How can I make addons works in my special way to use Vaadin ?
Here is why I didn’t succedd at first : my pom.xml file didn’t have the good plugins section for vaadin:update-widgetset command and neither for gwt:compile.
After finding that, I had an other problem : because I am using Vaadin v6.7.2, what are the version of theses plugins ?
I don’t use the execution parameters because I don’t want it to be executed for each compilation, I have a little script, that I instantiate myself :
mvn vaadin:update-widgetset gwt:compile
And finally, my last problem was that I don’t have a web.xml file, nor webapps folder, because of the instanciation of grizzly.
I had to add the
sa.addInitParameter("widgetset", "com.fiv.CustomWidgetSet");
in the code I provided earlier.
I created a
com.fiv.CustomWidgetSet.gwt.xml file in the resources folder of my maven project with the normal content :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
<inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />
<inherits name="com.github.wolfie.refresher.RefresherApplicationWidgetset" />
</module>