Building and testing
What you need
-
A JDK 21. The build targets Java 21 and the tests are skipped on anything older.
-
Maven 3.6.3 or newer — or nothing at all, and use the bundled wrapper
./mvnw.
./mvnw clean install That builds every module, runs the unit tests, applies the license and formatting checks, and produces the distributions under assemblies/.
Useful invocations
| Command | What it does |
|---|---|
| The full build. |
| Skips tests, Spotless, RAT, Javadoc and coverage. For a quick compile, never for a build you intend to trust. |
| Builds the code but not the distributions. Much faster when you are only changing Java. |
| One module and what it depends on. |
| Reformats the code. Run this before committing. |
| Unit tests of a single module. |
Profiles
Several profiles activate themselves, which is why the build usually needs no flags:
base/assemblies-
Decide which module sets are in the reactor. Both are on unless you pass
-Dbase=falseor-Dassemblies=false. swt-unix/swt-mac/swt-windows-
Selected by your operating system, and pick the matching SWT artifact.
swt-macalso adds-XstartOnFirstThreadto the test JVM, which SWT needs on macOS. assembly-
Activates for any module that has a
src/assemblyfolder, and packages it as a zip. This is why a plugin needs no assembly configuration in its pom. filtered-resources-
Activates for any module with a
src/main/resources-filteredfolder.
And the opt-in ones:
fast-build-
Skips every check and every test.
uitest/skip-uitest-
Run only, or skip, the SWTBot UI tests. See UI tests with SWTBot.
webtest-
The Selenium tests that drive Hop Web in a container. They need Docker and take minutes, so they are out of the normal build:
mvn -Pwebtest -pl web-tests test. apache-release/deploy-snapshots-
Release plumbing, including the CycloneDX SBOM. See the release process.
Checks that must pass
- Formatting — Spotless
-
Java is formatted with google-java-format, imports are ordered and unused ones removed, and
pom.xmlfiles are sorted. Run./mvnw spotless:applybefore you commit; CI runsspotless:checkand fails on any difference. - License headers — Apache RAT
-
Every source and text file needs the Apache License 2.0 header, including new
.adocpages. RAT fails the build otherwise. See Setting up your development environment for configuring your IDE to add it automatically. - Annotation index — Jandex
-
Bound for every module, so plugin discovery works. Nothing to do unless you are building a plugin outside this repository.
- Tests
-
JUnit 5 through Surefire. UI tests are tagged and can be included or excluded, see below.
What CI runs
Jenkinsfile-
The per-change build: full
clean deployunderxvfb-runso the UI tests have a display, an assembly size check (tools/check-assembly-size.sh— ASF Artifactory rejects packages over roughly 850 MB), then the Docker images and the snapshot deploy. Jenkinsfile.daily-
Build and test plus a code quality stage, and the integration tests against the built image.
Jenkinsfile.hop-web-selenium-
The Hop Web Selenium suite.
CI builds with -fae and -Dsurefire.rerunFailingTestsCount=2, so a flaky test can pass on CI and still be a real problem.
| This page is a scaffold. Still to write:
|