Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Agent guide for plexus-xml

`org.codehaus.plexus:plexus-xml` holds `Xpp3Dom`, `Xpp3DomBuilder`, `Xpp3DomWriter` and the XML pull
parser extracted from `plexus-utils`. The README is explicit that two lines exist: `3.x` (branch
`3.x`) needs Java 8 and works under Maven 3 and 4, while this `4.x` line on `master` requires Java 17
and works only under Maven 4. It builds on `maven-api-xml` at compile time and `maven-xml` at runtime;
the POM sets both through `mavenXmlVersion`, and `javaVersion` 17.

## Build and test

- CI calls the shared `codehaus-plexus/.github` `maven.yml@master` workflow, which runs
`mvn verify javadoc:javadoc` on Linux, Windows and macOS. This repository's workflow excludes JDK 8
and 11 from the matrix because the code needs Java 17; change that exclusion together with the Java
floor. A push to master also deploys a snapshot.
- Unit tests use JUnit 5 (`junit-jupiter-api` and `junit-jupiter-params`) and run through Surefire
with `childDelegation` on, so the test classes are used, not Surefire's own `plexus-utils`. There
are many test files, so iterate with targeted tests.
- The JAR sets `Automatic-Module-Name: org.codehaus.plexus.util.xml`; keep that name stable.
- Do not change the 3.x/4.x compatibility story casually: the README tells consumers on Maven 3 which
line they need.
- Run `mvn spotless:apply` on JDK 17 to 21 before pushing; it also formats Markdown, except
`src/site/markdown`.

## Documentation updates

A change that users or contributors can notice ships with the documentation it affects, in the same
pull request. A refactor with no visible effect needs none.

- Behaviour of a public class in `org.codehaus.plexus.util.xml` or `...xml.pull`: its Javadoc, which
is the reference.
- The release lines, the Java or Maven requirement, or the `maven-api-xml` dependency: the "Status"
and "Requirements" sections of `README.md`, and `src/site/markdown/index.md`.
- `src/site/markdown/index.md` is the only site page, listed as Introduction in `src/site/site.xml`
together with the Javadoc; add a menu item there when adding a page.
- A new convention, build gate or test fixture: this file.

9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Maven Central 4.x](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central%204.x&versionPrefix=4.)](https://central.sonatype.com/artifact/org.codehaus.plexus/plexus-xml/versions)
[![Maven Central 3.x](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central%203.x&versionPrefix=3.)](https://central.sonatype.com/artifact/org.codehaus.plexus/plexus-xml/versions)
[![GitHub CI](https://github.com/codehaus-plexus/plexus-xml/actions/workflows/maven.yml/badge.svg)](https://github.com/codehaus-plexus/plexus-xml/actions)
[![GitHub CI](https://github.com/codehaus-plexus/plexus-xml/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/codehaus-plexus/plexus-xml/actions/workflows/maven.yml?query=branch%3Amaster)
[![Reproducible Builds](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/org/codehaus/plexus/plexus-xml/badge.json)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/codehaus/plexus/plexus-xml/README.md)

Plexus XML contains the XML classes that [`plexus-utils`](https://github.com/codehaus-plexus/plexus-utils) shipped up to its 3.x
Expand Down Expand Up @@ -35,7 +35,7 @@ Maintained. Two lines are released from this repository, and they are not interc

`4.x` rebuilds `Xpp3Dom` on top of `XmlNode` from Maven 4's
[`maven-api-xml`](https://maven.apache.org/ref/4-LATEST/api/maven-api-xml/), and depends on `maven-api-xml`
and `maven-xml`. Don't use it in a plugin or extension that must run in Maven 3: Maven 3 exports its own
(compile scope) and `maven-xml` (runtime scope, which provides the `XmlService` implementation). Don't use it in a plugin or extension that must run in Maven 3: Maven 3 exports its own
`Xpp3Dom` class to plugins, and that class lacks the `XmlNode` constructor that `Xpp3DomBuilder` 4.x calls.

If upgrading `plexus-utils` from 3 to 4 gave you a `NoClassDefFoundError` on `Xpp3Dom` and
Expand All @@ -55,7 +55,7 @@ badges at the top of this page show the current version of each line.

## Requirements

Java 17 for `4.x`. Java 8 for `3.x`.
Java 17 for `4.x`. Java 8 for `3.x`. Both lines set the automatic module name `org.codehaus.plexus.util.xml`.

## Documentation

Expand All @@ -82,7 +82,8 @@ mvn spotless:apply

## Contributing

See [CONTRIBUTING.md](https://github.com/codehaus-plexus/.github/blob/master/CONTRIBUTING.md), and report
Conventions for contributors and agents are in [AGENTS.md](AGENTS.md); see also
[CONTRIBUTING.md](https://github.com/codehaus-plexus/.github/blob/master/CONTRIBUTING.md), and report
bugs in the [issue tracker](https://github.com/codehaus-plexus/plexus-xml/issues). Changes for Maven 3 users
go to the `3.x` branch.

Expand Down
5 changes: 4 additions & 1 deletion src/site/markdown/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ A collection of various utility classes to ease working with XML.

This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.codehaus.plexus.util.xml.pull`):
1. that have been extracted from [`plexus-utils`](../plexus-utils/) 4,
2. then updated to use [`maven-xml-api`](https://maven.apache.org/ref/4.0.0-rc-7/api/maven-api-xml/)/[`maven-xml`](https://maven.apache.org/ref/4.0.0-rc-7/impl/maven-xml/index.html)
2. then updated to use [`maven-api-xml`](https://maven.apache.org/ref/4-LATEST/api/maven-api-xml/)/[`maven-xml`](https://maven.apache.org/ref/4-LATEST/impl/maven-xml/index.html)

This is the 4.x line: it requires Java 17 and works only under Maven 4. The 3.x line, for Maven 3, is
built from the [`3.x` branch](https://github.com/codehaus-plexus/plexus-xml/tree/3.x) and requires
Java 8; the [README](https://github.com/codehaus-plexus/plexus-xml#status) explains which one to use.
Loading