Repository navigation
How to Upgrade GWT and Selenium in a Vaadin 8 Project Running on Java 11
Vaadin 8 was designed to be compatible with Java 8 and above. To honour that constraint, the framework ships with conservative transitive dependency versions of GWT and Selenium that work on all supported JDKs. But if you are building your project on Java 11 or later — or, as in this project, Java 21 — you can safely swap those older versions out for newer ones that take advantage of the modern JDK.
This guide walks you through exactly how to do that.
Sticking with the Java 8-compatible defaults means your project misses out on improvements accumulated over several major releases.
GWT 2.12+ / 2.13+
- Faster incremental compilation — the compiler takes advantage of modern JVM improvements to produce widgetsets noticeably quicker during development.
- Java language level support — GWT 2.11 already supports Java 11 language features in client-side code. GWT 2.13 goes further and adds limited Java 17 support, including text blocks and record types.
- Bug fixes and security patches — older GWT versions carry known issues that have long been resolved upstream.
- Better JVM compatibility — GWT 2.12+ is built to run cleanly on JDK 17 and 21, removing reliance on internal JDK APIs that were restricted or removed in newer releases.
Selenium 4.x
- W3C WebDriver protocol — Selenium 4 is fully W3C-compliant, dropping the legacy JSON Wire Protocol used by Selenium 3. This means better compatibility with current browser drivers (ChromeDriver, GeckoDriver) without workarounds.
- Relative locators — a new, more expressive way to find elements relative to other elements on the page.
- Native Chrome DevTools Protocol (CDP) support — enables network interception, performance metrics, and console log capture directly from tests without third-party libraries.
- Improved Grid — Selenium Grid 4 has a completely rewritten architecture (Hub-and-Node, Distributed, or Kubernetes-friendly) that is easier to operate and scale.
- Active maintenance — Selenium 3 is end-of-life; staying on it means no upstream bug fixes or driver compatibility updates.
In short, upgrading keeps your build toolchain aligned with the JDK you are already running and gives you access to years of downstream improvements without requiring any changes to your Vaadin application code.
When you add core Vaadin 8 client-side dependencies to a Maven project, you pull in GWT through transitive dependencies:
-
com.vaadin:vaadin-client→org.gwtproject:gwt-devandorg.gwtproject:gwt-userat the version Vaadin was built against (2.11.x — the latest GWT release that still supports Java 8) -
com.vaadin:vaadin-client-compiler→ same GWT artefacts
Similarly, Vaadin TestBench transitively drags in a pinned version of Selenium that is old enough to run on Java 8.
GWT 2.12 and newer require JDK 11 or newer to compile widgetsets. Selenium 4.x requires JDK 11 or newer at runtime. Attempting to use those newer versions without explicit configuration leaves you at the mercy of Maven's nearest-wins rule — which will resolve to the older versions that Vaadin itself declared.
The upgrade strategy is two steps:
- Exclude the transitive GWT artefacts from the Vaadin dependency that brings them in.
- Re-declare the same artefacts explicitly at the version you want.
This is the standard Maven override pattern and it works cleanly because neither gwt-dev nor gwt-user are needed at runtime — they are only used during widgetset compilation (provided scope).
Centralise the new versions as properties in your root (parent) pom.xml so every submodule picks them up automatically:
<properties>
<vaadin.gwt.version>2.13.0</vaadin.gwt.version>
<selenium.version>4.41.0</selenium.version>
</properties>Note: GWT 2.13.0 requires JDK 11+. Selenium 4.x requires JDK 11+. Only set versions here that your build JDK can support.
In the submodule that contains your custom GWT widgetset code (e.g. vaadincreate-components), the vaadin-client dependency brings in GWT transitively. Exclude those artefacts and then declare the newer version explicitly:
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
<!-- Exclude the older GWT bundled by Vaadin -->
<exclusions>
<exclusion>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-dev</artifactId>
</exclusion>
<exclusion>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-user</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Re-declare GWT at the version that matches your JDK -->
<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-dev</artifactId>
<version>${vaadin.gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-user</artifactId>
<version>${vaadin.gwt.version}</version>
<scope>provided</scope>
</dependency>Both artefacts are provided scope because they are only needed during the widgetset compilation phase and must not end up in the deployed WAR.
The UI module uses vaadin-client-compiler for widgetset compilation. Apply the same exclude-and-redeclare pattern there:
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiler</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-dev</artifactId>
</exclusion>
<exclusion>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-user</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-dev</artifactId>
<version>${vaadin.gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-user</artifactId>
<version>${vaadin.gwt.version}</version>
<scope>provided</scope>
</dependency>Vaadin TestBench bundles vaadin-testbench-core, which in turn brings in its own Selenium version. Override it in any submodule that runs integration tests by declaring selenium-java explicitly in test scope:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
<scope>test</scope>
</dependency>Maven's dependency resolution (nearest-wins) will prefer the version declared directly in your POM over anything pulled in transitively by TestBench, so no explicit exclusion is necessary here.
Vaadin TestBench ships a bundled license-checker. If you want to decouple yourself from that pinned version, you can exclude it from vaadin-testbench-core:
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench-core</artifactId>
<version>${testbench.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>license-checker</artifactId>
</exclusion>
</exclusions>
</dependency>After applying the changes, confirm the effective dependency tree resolves to the versions you declared:
mvn dependency:tree -Dincludes=org.gwtproject,org.seleniumhq.selenium
You should see gwt-dev, gwt-user, and selenium-java at the versions set in the root POM properties, with no older duplicates remaining.
| Library | Default (Java 8 compatible) | Upgraded (Java 11+) |
|---|---|---|
gwt-dev / gwt-user
|
2.11.x (bundled by Vaadin, latest Java 8 compatible) | 2.13.0 |
selenium-java |
~3.x (bundled by TestBench) | 4.41.0 |
The key insight is that Vaadin 8 is designed to allow these upgrades — it does not couple itself to a specific GWT or Selenium version at runtime. As long as the GWT compiler can still process Vaadin's client-side source (which it can up to the latest GWT release), the widgetset will compile and behave identically. The only hard requirement is that your build JDK must match the minimum required by the GWT and Selenium versions you choose.