Principle:SeleniumHQ Selenium Grid Server Building
| Knowledge Sources | |
|---|---|
| Domains | Distributed_Testing, Build_Systems, Selenium_Grid |
| Last Updated | 2026-02-11 00:00 GMT |
Overview
Process of compiling the Selenium Grid server from source using the Bazel build system to produce an executable fat JAR containing all Grid components.
Description
Selenium Grid is built using Bazel, a hermetic build system that ensures reproducible builds across different environments. The Grid server is packaged as a single executable JAR (selenium-server-<version>.jar) containing all components: Router, Distributor, Session Queue, Session Map, Node, Event Bus, and the web UI. The build target //java/src/org/openqa/selenium/grid:executable-grid produces this artifact. Bazelisk is the recommended launcher, as it automatically downloads the correct Bazel version specified in the project's .bazelversion file.
Usage
Build the Grid server when contributing to Grid code, testing local changes, or when you need a custom Grid build. For production use, pre-built JARs are available from Maven Central or GitHub Releases.
Theoretical Basis
# Pseudocode: Grid Build Process
1. Install Bazelisk (Bazel version manager)
2. Execute: bazel build //java/src/org/openqa/selenium/grid:executable-grid
3. Bazel resolves all transitive dependencies (Java, Protobuf, etc.)
4. Compiles Java sources for all Grid modules
5. Packages into fat JAR with all dependencies
6. Output: bazel-bin/java/src/org/openqa/selenium/grid/selenium-server-<version>.jar