This file is for automated agents and human contributors working on this repository. It records what the code and the POMs do not make obvious.
- One module with three goals in
org.codehaus.mojo.xml:validate(ValidateMojo, bound totest),transform(TransformMojo, bound togenerate-resources) andcheck-format(CheckFormatMojo, bound tovalidate). They shareAbstractXmlMojo;Resolveris the catalog-based entity, schema and URI resolver. validation,transformerandformathold the parameter types and the work of each goal, such asValidationSet,TransformationSetandIndentCheckSaxHandler.- The site is built from
src/site.
- On a local build Spotless applies the formatting; it also reformats Markdown, so run
mvn spotless:applyafter editing the README or this file. - The parent,
mojo-parent, setsmaven.compiler.releaseto 8, so main code must use the Java 8 API. - The plugin compiles against Maven 3.9.16 (
mavenVersion) and declares a literal<prerequisites><maven>3.9.0</maven>; keep the two apart, so raisingmavenVersiondoes not raise the prerequisite.
- JUnit 5 only.
ValidateMojoTestandTransformMojoTestextendAbstractXmlMojoTestCase, which carries@ProjectMojoTestand builds the mojo fromsrc/test/<case>/pom.xmlwithProjectMojos.lookup(goal, pom). A case is a directory (src/test/it1toit20,src/test/multimodule,xinclude-xsd,xinclude-xsl) that the test names inrunTest, so a new case needs a directory and a test method.
-
They live in
src/it, one directory per test, and run with maven-invoker-plugin in therun-itsprofile. The plugin is installed intotarget/local-repofirst, andsrc/it/settings.xmlpoints the forked builds at it. Eachinvoker.propertiesnames the goal, such asinvoker.goals = xml:check-format. -
Run a subset:
mvn -B -P run-its verify -Dinvoker.test=check-format-pass,it1
The tests have no
setup-*projects. -
They run in parallel, one per CPU core (
invoker.parallelThreads1C), so a test must not depend on another test's output. -
The forked builds get
JAVA_TOOL_OPTIONS=-XX:TieredStopAtLevel=1 -XX:+UseSerialGC, so every JVM prints aPicked up JAVA_TOOL_OPTIONSline on stderr. -
Most tests pass when the build succeeds; only
check-format-pass,check-format-failandxinclude-xslhave averify.groovy. Write it asassertstatements: Invoker fails a script whose last expression is anything other thantrueornull, so a trailinglist.each { }fails the test; use aforloop.
- Deliberate pins in
.github/dependabot.yml:maven-compat,maven-coreandmaven-plugin-apistay below 3.10.0, because the plugin baseline is the Maven 3.9.x line, andplexus-xmlstays below 4.0.0, because 4.x depends on the Maven 4 XML API.
.github/workflows/maven.ymlcalls the sharedmaven-verify.yml@v5workflow fromapache/maven-gh-actions-shared. Branches in this repository build under the push event, so look at the push run for a pull request from a same-repository branch.- Pull requests are squash- or rebase-merged; merge commits are disabled. Release Drafter builds the release notes from the titles and labels, so the title should describe the change for a user.