Using Vaadin on the Module Path
The Vaadin jars declare a stable Java Platform Module System (JPMS) module name in the Automatic-Module-Name entry of their manifest. On the module path, each jar is an automatic module with that name, instead of a name derived from its file name. Applications and add-ons can require Vaadin modules by these names in their module-info.java, and a name stays the same in later versions.
The Vaadin jars have no module descriptor of their own. As automatic modules, they export and open all their packages and read every other module. A module that reads one automatic module also reads all the other automatic modules on the module path. On the class path, the manifest entry has no effect.
Requiring Vaadin Modules
Add a requires directive to module-info.java for each Vaadin module whose packages your code uses. Vaadin uses reflection to create views and to read and write the beans that Binder binds. In a Spring application, Spring creates the views. Therefore, also open the packages that contain views and bound beans. An opens directive without a to clause opens the package to all modules, so it works with and without Spring:
Source code
Java
module com.example.app {
requires com.vaadin.flow.server;
requires com.vaadin.flow.data;
requires com.vaadin.flow.component.grid;
requires com.vaadin.flow.component.textfield;
opens com.example.app.views;
}The following limitations apply:
-
Development mode doesn’t run from the module path. During development, run the application from the class path.
-
The Spreadsheet jar contains a class in the
org.apache.poi.ss.formulapackage, which theorg.apache.poi:poijar also contains. Two modules on the module path can’t contain the same package, so Spreadsheet can’t be used from the module path. -
Build plugins, TestBench, and other jars that are used only at build or test time have no declared module name.
vaadin-charts-flow-svg-generator, which is used for exporting charts, has no declared module name either.
Naming Rule
Most module names are the root package of the jar’s code, such as com.vaadin.flow.data for flow-data. Module Names lists the names of the Flow, platform, and browser-callable services jars.
The jars of the UI components are named com.vaadin.flow.component. followed by the artifact ID without vaadin- and -flow, and without dashes. For example, vaadin-combo-box-flow is com.vaadin.flow.component.combobox, and vaadin-grid-pro-flow is com.vaadin.flow.component.gridpro. The following jars have a different name, because their root package differs:
| Artifact ID | Module Name |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module Names
The following tables list the module names that applications and add-ons most commonly require. The UI component jars aren’t listed, because their names follow the naming rule.
Flow
| Artifact ID | Module Name |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Browser-Callable Services and React Views
| Artifact ID | Module Name |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|