Optimizing WidgetSet compilation

We have a module (JAR) where we include Vaadin, Vaadin charts, a few addons. Then we use this module in a web app(WAR) that does not add any new features that would require compiling a new WidgetSet. Up to the version of 7.6.7 of the vaadin-maven-plugin, the WidgetSet would only be compiled once in the library module and then the web app would use the WidgetSet already compiled in the module. Starting with the version 7.6.8 of vaadin-maven-plugin, a WidgetSet compilation also happens in the web app instead of using the one from the JAR. It’s two WidgetSet compilation instead of one and each compile take a lot of time (actually, because we have 3 web apps that use the mentioned module, it is 4 widgetset compilations and it takes really long time!). I tried to turn off the widgetset compilation in the web apps but it still says this during the build

[INFO]
— vaadin-maven-plugin:8.1.2:compile (default) @ calc_webui —
[INFO]
auto discovered modules [AppWidgetset]

[INFO]
Compiling module AppWidgetset

and goes on compiling it (this is outpupt from 8.1.2 version of plugin). I have been using version 7.6.7 with newer (even Vaadin 8) to avoid extra widgetset compilations but I am afraid one day it is going to cause issues. Is there a way to turn off WidgetSet compilation with the newer plugin versions when it is not needed?

Thank you for your help!

A lot of useful information on compiling widget set can be found here (of course, the documentation!)


https://vaadin.com/docs/-/part/framework/addons/addons-maven.html#addons.maven.modes

In our case, the widget set is compiled in a JAR which is them used in a web app that does not add anything to the widget set. To trun off widget set compilation for a module simply remove the vaadin-maven-plugin from the list of plugins in the build configuration.

However, if the plugin is not listed the theme scc will not be built either. It would be nice if we could still use the plugin to compile the theme but do not compile the widget set if one already available and the module does not need to add anything to it. Anyone knows how to do it?

The closest thing to “turning off” the widget set compilation that I was able to find is to add this to a module’s pom.xml

<properties> <vaadin.widgetset.mode>cdn</vaadin.widgetset.mode> </properties> and then specify a widget set from another module that is already compiled locally.