Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Developing an addon using the vaadin-archetype-widget Maven archetype
I have a custom server-side/client-side component that I created in a simple mvn project with a demo UI in the same project. I'm trying to migrate it to the multi-module structure in the vaadin-archetype-widget Maven archetype (with the addon and demo UI in separate sub-modules).
I can run the demo UI using mvn clean install, followed by mvn jetty:run. I can also debug server-side and client-side in IntelliJ and Chrome (settings breakpoints, inspecting values etc).
The one thing I can't get my head around is recompiling the addon following changes and seeing those changes in the demo UI. If I make a change to the addon code and restart the demo UI debugger I don't see the changes.
What is the easiest way to recompile the addon and restart the demo UI without having to do a full clean/install? I'm sure there must be an easy way to do this but my understanding of Maven multi-module projects is lacking.
Thanks for any help,
I had a similiar issue, but never found way out. Instead, I ended up developing my custom component in the same project as demo app and splitting the two later, when I was done with debugging. I don't know if there's other reasonable way to deal with this issue…
I ditched the widget-archetype today and went with the project structure from the TinyMCE wrapper https://github.com/mstahv/tinymcewrapper . This has the demo/test UI in the same project so you can easily build and debug it. The demo UI is a 'test' class and so is excluded from the addon build. This is working well for me - I can add 'test' resources needed by the Demo UI, debug easily, and build a Directory-compatible addon zip with a single mvn command.
Anyone else have any suggestions for organising addon projects? Also any advice on unit testing?
This is definitely the way to go with add-on projects. The development cycle with the add-on archetype is not that nice and it don't provide any good way to have your use cases/tests listed for the development time. That is also how Vaadin Ltd's on add-ons like TouchKit and Charts are developed.
I read the blog post you linked to and followed the example with sparklines. This was just what I needed. I now have a minimal framework for developing and testing addons. Thanks!