/xwiki:xwiki-buildfrom xwiki
Builds and tests XWiki Maven modules with correct JDK, profiles, and flags. Handles multi-module builds, unit/integration tests, and common failure modes.
Ships in xwiki. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
XWiki is a multi-module Maven project. Almost every build needs the legacy profile.
Always pass -B -ntp (batch mode + no-transfer-progress) on every mvn invocation. This
removes all interactive prompts and the download/progress lines that otherwise flood the output —
keep it on the commands below and on any new mvn command you run.
Always start with clean (mvn clean <goal>). XWiki builds leave generated artifacts and
per-module state behind, and stale target/ (and locally-installed SNAPSHOTs) cause confusing,
hard-to-diagnose failures — including a jar from the Develocity build cache that lacks your edit,
installed under BUILD SUCCESS.
xmvnNever build on the machine default JDK without checking it: a too-new JDK fails in ways that read as
code or configuration problems and are neither — JaCoCo aborts instrumenting with Unsupported class file major version NN (its bundled ASM cannot read the JDK's own classes, so every -Pquality
build fails), and the Spoon plugin fails with could not add URL to system classloader.
Every command below is written mvn; run it as xmvn whenever command -v xmvn finds one. xmvn
ships with xwiki-dev-tools (bash/xmvn): run from the
directory holding the pom, it reads xwiki.java.version from it (falling back to deducing it from the
XWiki version), exports the matching JAVA_HOME, then delegates to mvn. It also raises that version
when the arguments contain a sonar goal, the Sonar scanner having a JDK floor of its own — above what
the older branches target.
Wherever xmvn isn't available, select the JDK yourself. If a build still fails as above under
xmvn, it didn't switch the JDK — set JAVA_HOME yourself the same way:
mvn -N -B -ntp -q -DforceStdout help:evaluate -Dexpression=xwiki.java.version # e.g. 11
JAVA_HOME=<path to a JDK of that version> mvn clean install -B -ntp -Plegacy
Which Java version each XWiki version needs is in the Java support strategy (linked from the org-wide
conventions); for a sonar:sonar run, xmvn and xwiki-jenkins-pipeline's
vars/configureJavaTool.groovy hold the scanner's current floor — read it there rather than pinning a
number here, since it moves with the sonar-maven-plugin version.
mvn clean install -B -ntp -Plegacy \
-Dxwiki.checkstyle.skip=true -Dxwiki.surefire.captureconsole.skip=true \
-Dxwiki.revapi.skip=true
Without the integration-tests profile, *IT.java tests don't run. To include integration tests,
add -Pintegration-tests (and -Pdocker for the Docker-based ITs). -DskipITs skips ITs while
keeping unit tests; -DskipTests skips all tests.
These skip flags are for speed only. They disable Checkstyle, API compatibility checks, and console-capture validation to make the full multi-module build faster. Do NOT carry them over to single-module builds when you need to validate code quality (e.g., before committing).
mvn clean install -B -ntp -pl <module-path> -Plegacy
For example in xwiki-platform: -pl xwiki-platform-core/xwiki-platform-<module>.
This command runs Checkstyle, API compat (Revapi) and the other default checks, and is the correct
way to validate code quality before committing. Do not add the skip flags from the full build recipe
here unless you explicitly want to bypass those checks. It does not, however, run the JaCoCo
test-coverage check — add -Pquality for that (see Notes); do so whenever the change touches
production code.
The front-end packages of xwiki-platform are an Nx monorepo over a pnpm workspace, and their
sources live inside the core modules that ship them — xwiki-platform-livedata,
xwiki-platform-ckeditor, xwiki-platform-blocknote. So a Maven build of one of those modules
builds its JavaScript too, and a JavaScript-only change can be iterated far faster outside Maven:
pnpm install # from the repo root, once
pnpm run build # every package
pnpm --filter @xwiki/blocknote run build # one package
Use pnpm, not npm: the workspace is defined by a pnpm lockfile, and npm install in it produces
a different tree that then fails in ways the lockfile was there to prevent. The Maven build remains
the oracle — a change that passes pnpm run build still has to pass its module's mvn build, which
is what runs the linters and packages the WebJar. Front-end conventions (AMD modules, WebJars,
skin extensions, accessibility) are kb/conventions/frontend.md, not this skill.
A change that spans many modules (a cross-cutting sweep, a refactoring) is only verified for the modules you actually ran the checks on. Build them all in one reactor rather than picking a representative few:
mvn clean install -B -ntp -Plegacy,quality -fae -pl <comma-separated module paths>
-fae (fail-at-end) keeps going so one broken module doesn't hide the state of the rest. Derive the
list mechanically from the diff (git show --name-only, then walk up to the nearest pom.xml) —
not from memory of what you edited.
-pl rejects a path with "Could not find the selected project in the reactor" even when the path
is correct when the module is only activated by a profile: *-test-docker modules need
-Pdocker,integration-tests, and xwiki-platform-distribution/** needs -Pdistribution. Add the
profiles, or build that module from its own pom.xml.
mvn checkstyle:check is NOT the check CI runsA single-module install/verify runs the real Checkstyle. When you want Checkstyle feedback on its
own — it needs no compilation, so it is seconds per module instead of minutes — you must name the
execution, not the bare goal:
mvn -B -ntp checkstyle:check@default checkstyle:check@test -pl <module-path>
mvn checkstyle:check(no@…) silently checks almost nothing. A goal invoked from the command line takes the plugin-level<configuration>, and in the XWiki parent POM that setsconfigLocation=checkstyle-blocker.xml— a handful of blocker rules. The real rulesets live in the plugin's executions:default→checkstyle.xmloversrc/main/java(the one CI reports as "N errors reported by Checkstyle X with checkstyle.xml ruleset"),test→checkstyle-test.xmloversrc/test/java,blocker→checkstyle-blocker.xml. So a barecheckstyle:checkprintsYou have 0 Checkstyle violations/BUILD SUCCESSon code that fails CI: a green run of it is evidence of nothing, and reporting it as "Checkstyle passes" is wrong.
Some modules are wrapped by a -legacy module that re-adds deprecated/removed APIs by weaving the
original module's bytecode with AspectJ. That legacy module compiles and tests against your changed
code, so a change that builds fine on its own can still break the legacy module.
A legacy module wraps your module when its pom.xml configures aspectj-maven-plugin with a
<weaveDependency> whose <artifactId> is the module you changed. For example, a change to
xwiki-platform-oldcore must also be validated by rebuilding xwiki-platform-legacy-oldcore:
grep -rl '<weaveDependency>' --include=pom.xml # find legacy modules and inspect their weaveDependency artifactIds
When such a legacy module exists, build it too (single-module build, all checks on) to confirm it still compiles and its tests still pass:
mvn clean install -B -ntp -pl <legacy-module-path> -Plegacy
# All unit tests in a module
mvn test -B -ntp -pl <module-path>
# A single test class
mvn test -B -ntp -pl <module-path> -Dtest=MyTestClass
# A single test method
mvn test -B -ntp -pl <module-path> -Dtest=MyTestClass#myMethod
# Integration tests
mvn verify -B -ntp -pl <module-path> -Pintegration-tests
# Methods of a Docker test nested in AllIT (quote the $; + joins methods)
mvn verify -B -ntp -pl <module-path> -Pdocker,integration-tests -Dit.test='AllIT$NestedXxxIT#m1+m2'
A -Pdocker,integration-tests run is a machine-wide operation: it takes host ports or a slice of
the Docker daemon, and writes SNAPSHOT artifacts into the shared ~/.m2. Other agents, other
worktrees and the developer's own wiki are all on the same machine. Why each step below exists — and
the table that tells a starved daemon from a real defect — is in kb/testing/running-docker-its.md
(in Claude Code ${CLAUDE_PLUGIN_ROOT}/kb/testing/, in Kimi Code
${KIMI_SKILL_DIR}/../../kb/testing/, in opencode $XWIKI_LLM_HOME/xwiki/kb/testing/).
1. Pre-flight — read the output before launching anything:
lsof -nP -iTCP:8080 -sTCP:LISTEN # who owns the standalone port
ps -Ao command | grep "[i]ntegration-tests,docker" # other agents' runs
docker ps --format '{{.Names}}\t{{.Image}}\t{{.Status}}' # what the daemon already carries
Testcontainers leftovers — browser containers and networks of finished runs — mean ryuk could not
remove them, and once the networks exhaust the daemon's address pools every run dies in beforeAll.
xwiki-it-slot.mjs --status counts them, and the wrapper runs testcontainers with a ryuk the daemon
accepts; the cause, the per-machine fix and the cleanup are in running-docker-its.md.
2. Never stop an XWiki instance you did not start. @UITest defaults to JETTY_STANDALONE,
which runs XWiki on the host and binds 8080/8079. When something already listens there, the
test's Jetty silently fails to bind, the framework drives that instance, and beforeAll dies with
Failed to install Extension(s) … Response status code [401]. Stop the instance only when this
session started it; otherwise leave it running and move the servlet engine into a container.
3. Pick the engine deliberately — the two are not interchangeable. The browser is a container in
both, but under JETTY_STANDALONE it reaches the host wiki through an /etc/hosts host-gateway
entry, while a containerised engine resolves the xwikiweb alias over Docker's embedded DNS. They
exercise different networking, and the containerised one is what the CI matrix runs.
# Local iteration loop — fastest, and structurally cannot fail on container-to-container DNS.
# Needs :8080 free. JETTY_STANDALONE spawns the wiki's JVM with `java` from PATH, so put the right
# JDK there and not only in JAVA_HOME:
export JAVA_HOME=$(/usr/libexec/java_home -v 17); export PATH="$JAVA_HOME/bin:$PATH"
mvn verify -B -ntp -pl <module-path> -Pdocker,integration-tests
# Containerised engine — required when :8080 is taken, when the change touches how the test reaches
# the wiki (URLs, ports, host names, shared files, uploads/downloads), and before calling a green
# local run CI-safe.
mvn verify -B -ntp -pl <module-path> -Pdocker,integration-tests \
-Dxwiki.test.ui.servletEngine=tomcat -Dxwiki.test.ui.database=postgresql
4. Take a slot, so concurrent agents queue instead of starving the daemon. Wrap the whole
Maven invocation (the install of the SNAPSHOTs is part of what is being serialised). The slot is
released however the command ends, and a slot whose holder died is reclaimed automatically:
node "${CLAUDE_PLUGIN_ROOT}/scripts/xwiki-it-slot.mjs" -- \
mvn verify -B -ntp -pl <module-path> -Pdocker,integration-tests
node "${CLAUDE_PLUGIN_ROOT}/scripts/xwiki-it-slot.mjs" --status # who is holding what
Two runs at a time by default (--max N, or XWIKI_LLM_IT_SLOTS). Exit code 75 means no slot
came free within --wait (3600s default) — report which run holds it rather than launching anyway.
-Dxwiki.test.ui.keepRunning=true leaves the wiki up after the tests and blocks Maven until
stop.txt exists in the module directory (the log says so after Access XWiki at:) — never
background it without planning to create that file. Create it empty (touch stop.txt): the
framework then deletes it, so its absence afterwards means the stop worked. A non-empty file is kept
(with a warning), fails the class on the "files outside target/" check, and stops the next
keepRunning run at once.
To run one test many times — measuring a flicker's pass rate rather than seeing whether it
passed once — use scripts/xwiki-it-repeat.mjs instead of looping by hand. It takes the slot for
the whole session, keeps each failing repetition's report, screenshot and video, excludes the runs
that died in beforeAll from the rate, and writes a report.json and a pasteable summary.md:
node "${CLAUDE_PLUGIN_ROOT}/scripts/xwiki-it-repeat.mjs" --module <module-path> \
--test TestClass#testMethod --runs 20 --browser chrome --label before
The xwiki-fix-flickering-docker-test skill owns when and how to use it.
5. A failure in beforeAll is never evidence about your change.
RuntimeException: Error setting up the XWiki testing environment means no test method ran. Repair
the machine and re-run; the symptom table in the KB topic says which cause each line points at.
Standardized across all XWiki projects — see https://dev.xwiki.org/xwiki/bin/view/Community/Building/#HUsingProfiles for the full list and definitions.
| Profile | Purpose |
|---|---|
legacy | Includes backward-compatibility (-legacy) modules; almost always needed |
integration-tests | Activates integration-test (*IT.java) execution via Failsafe |
docker | Runs the Docker-based integration tests (requires Docker installed); used together with integration-tests |
quality | The JaCoCo coverage check and Javadoc generation (see Notes); Checkstyle, Revapi and the Enforcer already run without it |
legacy profile activates backward-compatibility shim modules and is almost always required.-Dxwiki.checkstyle.skip=true (Checkstyle),
-Dxwiki.revapi.skip=true (API compat), -Dxwiki.surefire.captureconsole.skip=true
(stdout capture check), -Dxwiki.jacoco.skip=true (JaCoCo — not -Djacoco.skip, which the
parent POM overrides).verify phase (not test), so mvn test won't catch them —
use mvn clean verify or install to validate.-Pquality. The jacoco:check goal that
enforces each module's xwiki.jacoco.instructionRatio minimum is bound inside the quality
profile in the parent POM — a plain mvn clean install (even a single-module one) never runs it.
So any code change must be verified with -Pquality to confirm it didn't drop the module below
its pinned coverage ratio, e.g. mvn clean install -B -ntp -pl <module-path> -Plegacy,quality.
Because each module pins the ratio to its achieved coverage (locked in by the
xwiki-increase-test-coverage skill), there is almost no slack: removing or simplifying code —
including a mechanical SonarQube fix — can shift the covered/total instruction ratio and fail the
check. This failure is invisible without -Pquality and only surfaces in CI (which builds with it).
Running a subset of a module's tests (-Dtest, -Dit.test) under -Pquality fails this check
even when they pass; add -Dxwiki.jacoco.skip=true.mvn from the repo root. A -pl <relative-path> build launched from anywhere else
fails fast with "Could not find the selected project in the reactor" — that is a path error, not a
code error. Relaunch from the root.SUCCESS before it
in the summary are genuinely verified; the ones after were never built. After fixing or dropping the
failing module, re-run a reactor containing the skipped ones — the first run did not cover them.SUCCESS stands and those
modules need no rebuild. To tell whether a failure is yours: if git diff --name-only does not list
the flagged class, it is not — confirm with git log -1 -- <that class's file>, which will point at
an unrelated recent commit. A pre-existing red module on master (a Revapi failure left by an
in-flight migration, say) fails your reactor without being your fault.-am (also-make) is only needed when a X.Y.0-SNAPSHOT sibling is genuinely unpublished. A
"Could not find artifact" for a sibling is a resolution error, not a code error; otherwise SNAPSHOT
siblings resolve from ~/.m2 or the XWiki remote repositories, and adding -am needlessly slows a
-Pquality build by rebuilding the upstream tree.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub xwiki/xwiki-dev-llm --plugin xwiki38 skills in this plugin
/xwiki-backportBackport any change (bug fix, feature, refactor, or test) to an older branch of an XWiki repo (xwiki-platform / xwiki-commons / xwiki-rendering / xwiki-contrib). Cherry-pick `-x` the source commit(s) into a worktree, ADAPT the result to the older branch (module pom versions, Java level, `@since` tags, data migration versions and skip ranges, style/API divergence), verify it compiles against that branch, and push / open a PR. Use whenever a commit that exists on one branch needs to be applied to an older/maintenance branch. For the `testneeded`-labelled test sweep use xwiki-backport-testneeded (which builds on this skill); for Maven commands use xwiki-build; for PR/commit conventions use xwiki-pull-request; for the versioning/`@since` conventions (the format and what carries `@since`) use xwiki-knowledge./xwiki-backport-testneededBackport the automated test of one JIRA issue labelled `testneeded` to the currently-supported stable branches, adjust its `@since` tags across all branches, and open the PRs. Use when asked to backport the test of a given testneeded issue, or to catch a stable branch up with a recently-added test. (For several issues at once, the user will say so — then apply this per issue.) This is the test-specific layer on top of xwiki-backport (which owns the generic cherry-pick / adapt-to-branch / verify mechanics — including the mandatory pom-version, Java-version and `@since` checks). For Maven use xwiki-build; for PR/commit conventions use xwiki-pull-request; for the `@since` rules use xwiki-knowledge; for querying JIRA (the testneeded sweep) use xwiki-jira./xwiki-capture-ui-changeCapture the "before" screenshot of a fix to existing XWiki UI when the branch can no longer produce it (the fix is already in the working tree) - on the released version's Docker image, or by building and deploying the pre-fix code on a local instance - and shoot the same fixture in both states. Costs minutes to tens of minutes, so propose it and run it only with the user's explicit approval. Not for a new feature or a redesign (there is no "before"), nor when the bug can still be shot on a running instance before applying the fix. For deploying an extension without a comparison use xwiki-deploy-extension; for Maven commands use xwiki-build; for the PR/JIRA screenshot conventions use xwiki-pull-request; for manually testing every fix of a release use xwiki-manual-test./xwiki-ci-checkEXPLICIT INVOCATION ONLY — never load this skill to answer a question about CI. The daily acting sweep of ci.xwiki.org: it turns what is red on the maintained branches into incidents, attributes each to the commit that caused it and comments there, opens PRs for mechanical fixes (a failing quality gate or a build break first), files proven flicker issues, drafts a fix for one flicker, and posts a digest to Matrix. Only with --write does it write to GitHub, JIRA and Matrix; otherwise it analyses to stdout and asks before each write. Use ONLY when named — `/xwiki-ci-check`, "run the CI check", or a scheduled routine invoking it by name. Do NOT use it for "what's the CI status?", "is master green?", "why is this test failing?" or any other read-only CI question: those are xwiki-release-test-triage. To fix one flicker use xwiki-fix-flickering-docker-test, to file an issue use xwiki-jira, to open a PR use xwiki-pull-request, for Maven use xwiki-build, for Sonar findings use xwiki-fix-sonarqube-issue./xwiki-contrib-releaseRelease an xwiki-contrib extension (groupId org.xwiki.contrib) end to end — preflight, `mvn release:prepare`/`release:perform` to nexus.xwiki.org, the issue-tracker version (JIRA or OpenProject), the extensions.xwiki.org import and release notes, then the hand-off to the announcement. Use when asked to release or publish a version of a contrib extension ("release v1.15 of the doc app"). Not for xwiki-commons/rendering/platform releases (use xwiki-xs-release). For the blog post use xwiki-contrib-release-blog-post; for Maven/JDK use xwiki-build; for tracker calls use xwiki-jira or xwiki-openproject./xwiki-contrib-release-blog-postAnnounce an xwiki-contrib extension release by creating the "<Extension> Extension <version> Released" blog post on the xwiki.org Blog, following the contrib release-documentation convention (page name, title, content/summary templates, categories, publish date). Use after releasing an xwiki-contrib extension (groupId org.xwiki.contrib) when the blog-post step of the release documentation still needs doing (the release itself is xwiki-contrib-release). This is for contributed extensions only — not core xwiki-platform releases; for the release notes and issue documentation of a core release use xwiki-release-documentation. For writing/reviewing general documentation pages use xwiki-doc-writing instead; for deploying a XAR/JAR to a running instance use xwiki-deploy-extension; for a slide deck about a release use xwiki-presentation.