diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..c58b2c943 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,45 @@ +# Agent guide for modello + +Modello (`org.codehaus.modello:modello`, `pom` packaging, inheriting the `plexus` parent) is a +code-generation framework: one `.mdo` model produces Java classes, readers and writers for XML, YAML +and JSON, an XSD and documentation; Maven uses it for its own POM and `settings.xml` models. The +reactor has `modello-core`, `modello-maven-plugin`, `modello-plugins` (one module per generator), +`modello-test` and `modello-ant-task`. It is MIT-licensed, unlike most Codehaus Plexus projects. + +## Build and test + +- `mvn verify` builds and runs the unit tests. The invoker integration tests of + `modello-maven-plugin` run only under `-Prun-its`. +- Run `mvn spotless:apply` on JDK 17 to 21 before pushing; CI fails on formatting otherwise. +- The code targets Java 8 (`javaVersion` 8 from the `plexus` parent), and the plugin's + `prerequisites` require Maven 3.9.0. `mavenVersion` pins the Maven 3.9 line that the plugin and + core are built against, so keep it on 3.9.x. +- CI calls the shared `codehaus-plexus/.github` build workflow with + `verify javadoc:javadoc -Prun-its`, on the shared JDK and operating system matrix. +- The plugin tests compile the generator output together with the classes in + `src/test/verifiers`; `modello-plugins/README.md` explains that layout. +- `src/main/mdo/modello.mdo` describes the model descriptor format. The `reporting` profile renders + it into `modello.html` on the site, so change it together with the code that implements the format. + +## 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. + +- A goal added, renamed or removed in `modello-maven-plugin`: the goal list in + `modello-maven-plugin/src/site/markdown/index.md`, and `usage.md` or the example page if the + recommended configuration changes. Examples show the plugin version as + `` on the first declaration of `usage.md` and no version + elsewhere; the pages are plain Markdown, not Velocity templates. +- A parameter added or changed on a goal: its Javadoc, which is the goal page. Document the default, + the property name and `@since`. +- A generator changed or added in `modello-plugins`: that module's `src/site/markdown/index.md` + and its `src/site/site.xml`. +- A model attribute or generated API that needs a change in users' models: `modello.mdo`, and + `src/site/markdown/migration-guide.md` when it breaks existing models. +- Location tracking behavior: `src/site/markdown/location-tracking.md`. +- Ant task attributes or goals: `modello-ant-task/README.md`. +- The Java or Maven requirement, or how to build and release: `README.md`. +- A new convention, build gate or test fixture: this file, or `modello-plugins/README.md` for the + verifier layout. + diff --git a/README.md b/README.md index ac622381a..95f8484ee 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Modello [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.modello/modello-maven-plugin.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/org.codehaus.modello/modello-maven-plugin) -[![GitHub CI](https://github.com/codehaus-plexus/modello/workflows/GitHub%20CI/badge.svg)](https://github.com/codehaus-plexus/modello/actions) +[![GitHub CI](https://github.com/codehaus-plexus/modello/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/codehaus-plexus/modello/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/modello/badge.json)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/codehaus/modello/README.md) -[![MIT License](https://img.shields.io/github/license/codehaus-plexus/modello.svg?label=License)](https://opensource.org/licenses/mit-license.php) +[![MIT License](https://img.shields.io/github/license/codehaus-plexus/modello.svg?label=License)](https://opensource.org/license/mit) Code generation from a single model file. You describe your data model once in an `.mdo` file, and Modello generates the Java classes, the readers and writers, an XSD and the documentation — all kept in step, @@ -46,15 +46,16 @@ Check the badge above for the current version. Each goal is a generator; pick th ## Generators -Java classes, plus readers and writers for XML (XPP3, StAX, SAX, DOM4J, JDOM), YAML (SnakeYaml, Jackson) -and JSON Schema, plus XSD, xdoc documentation and version converters. Velocity templates are supported +Java classes, plus readers and writers for XML (XPP3 and StAX; DOM4J readers and writers; SAX and JDOM +writers only), YAML (SnakeYaml) and JSON (Jackson), plus JSON Schema, XSD, xdoc documentation and +version converters. Velocity templates are supported since 2.1.0 for anything not covered. -Each has its own page under [Plugins](https://codehaus-plexus.github.io/modello/) on the site. +Each has its own page under [Plugins](https://codehaus-plexus.github.io/modello/modello-plugins/) on the site. ## Requirements -Java 8 or later. +Java 8 or later, and Maven 3.9.0 or later to run the Maven plugin. ## Documentation @@ -63,14 +64,14 @@ Java 8 or later. ## Licensing -Modello is licensed under the [MIT License](https://opensource.org/licenses/mit-license.php). The rest of +Modello is licensed under the [MIT License](https://opensource.org/license/mit). The rest of the Codehaus Plexus projects are Apache-2.0. ## Contributing -See [CONTRIBUTING.md](https://github.com/codehaus-plexus/.github/blob/master/CONTRIBUTING.md). In short: -`mvn verify` builds, and run `mvn spotless:apply` before pushing or CI will fail on formatting. Integration -tests run under `-Prun-its`. +See [CONTRIBUTING.md](https://github.com/codehaus-plexus/.github/blob/master/CONTRIBUTING.md) and +[AGENTS.md](AGENTS.md). In short: `mvn verify` builds, and run `mvn spotless:apply` before pushing or CI +will fail on formatting. Integration tests run under `-Prun-its`. Please report security vulnerabilities privately — see [SECURITY.md](https://github.com/codehaus-plexus/.github/blob/master/SECURITY.md), not a public issue. diff --git a/modello-ant-task/README.md b/modello-ant-task/README.md index 9c674cd48..ece0f90c7 100644 --- a/modello-ant-task/README.md +++ b/modello-ant-task/README.md @@ -33,24 +33,24 @@ The `` task supports several attributes and nested elements to configur ### Attributes -| Attribute | Type | Description | Required | Default | -|:-------------------------------|:----------|:--------------------------------------------------------------------------------------|:--------:|:---------------:| -| **`version`** | `String` | The model version to generate (e.g., `1.0.0`). | **Yes** | — | -| **`outputDirectory`** | `File` | The directory where the generated files will be written. | **Yes** | — | -| **`javaSource`** | `String` | Target Java version for generated source code. | No | `8` | -| **`encoding`** | `String` | Character encoding for generated files. | No | `"utf-8"` | -| **`packageWithVersion`** | `boolean` | Whether to append the version to the package name (`"true"` / `"false"`). | No | `false` | -| **`packagedVersions`** | `String` | Additional historical versions, each generated into a versioned package. | No | — | -| **`domAsXpp3`** | `boolean` | Whether to generate DOM content as Xpp3Dom (`"true"`) or W3C DOM Element (`"false"`). | No | `true` | -| **`licenseFile`** | `File` | Path to file containing license header text to prepend to generated files. | No | — | -| **`licenseText`** | `String` | License header text to prepend to generated files. | No | — | -| **`extendedClassnameSuffix`** | `String` | Writer class name suffix for the `xpp3-extended-writer` goal. | No | `Ex` | -| **`xsdFileName`** | `String` | Custom output file name for generated XSD schema (`xsd` goal). | No | — | -| **`enforceMandatoryElements`** | `boolean` | Whether to enforce mandatory elements in XSD (`"true"` / `"false"`). | No | `false` | -| **`jsonSchemaFileName`** | `String` | Custom output file name for generated JSON Schema (`jsonschema` goal). | No | — | -| **`firstVersion`** | `String` | Earliest version to document when generating documentation (`xdoc` goal). | No | — | -| **`xdocFileName`** | `String` | Custom output file name for generated XDoc documentation (`xdoc` goal). | No | — | -| **`velocityBasedir`** | `File` | Base directory of Velocity templates (`velocity` goal). | No | project basedir | +| Attribute | Type | Description | Required | Default | +|:-------------------------------|:----------|:----------------------------------------------------------------------------------------|:--------:|:---------------:| +| **`version`** | `String` | The model version to generate (e.g., `1.0.0`). | **Yes** | — | +| **`outputDirectory`** | `File` | The directory where the generated files will be written. | **Yes** | — | +| **`javaSource`** | `String` | Target Java version for generated source code. | No | `8` | +| **`encoding`** | `String` | Character encoding for generated files. | No | `"utf-8"` | +| **`packageWithVersion`** | `boolean` | Whether to append the version to the package name (`"true"` / `"false"`). | No | `false` | +| **`packagedVersions`** | `String` | Additional historical versions, each generated into a versioned package. | No | — | +| **`domAsXpp3`** | `boolean` | Whether to generate DOM content as Xpp3Dom (`"true"`) or W3C DOM Element (`"false"`). | No | `true` | +| **`licenseFile`** | `File` | Path to file containing license header text to prepend to generated files. | No | — | +| **`licenseText`** | `String` | License header text to prepend to generated files. | No | — | +| **`extendedClassnameSuffix`** | `String` | Writer class name suffix for the `xpp3-extended-writer` goal. | No | `Ex` | +| **`xsdFileName`** | `String` | Custom output file name for generated XSD schema (`xsd` goal). | No | — | +| **`enforceMandatoryElements`** | `boolean` | Kept for backward compatibility; it has no effect, required fields are always enforced. | No | `false` | +| **`jsonSchemaFileName`** | `String` | Custom output file name for generated JSON Schema (`jsonschema` goal). | No | — | +| **`firstVersion`** | `String` | Earliest version to document when generating documentation (`xdoc` goal). | No | — | +| **`xdocFileName`** | `String` | Custom output file name for generated XDoc documentation (`xdoc` goal). | No | — | +| **`velocityBasedir`** | `File` | Base directory of Velocity templates (`velocity` goal). | No | project basedir | ### Nested Elements diff --git a/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloGenerateMojo.java b/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloGenerateMojo.java index 301cdc41e..cdb6e52c9 100644 --- a/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloGenerateMojo.java +++ b/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloGenerateMojo.java @@ -91,6 +91,10 @@ public class ModelloGenerateMojo extends AbstractModelloSourceGeneratorMojo { private final Map generatorMap; + /** + * The id of the generator to run, as registered by a Modello plugin, for example {@code java} or + * {@code xpp3-reader}. The build fails and lists the available ids if no generator has this id. + */ @Parameter(property = ModelloParameterConstants.GENERATOR_ID, defaultValue = "java") private String generatorId; diff --git a/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloJsonSchemaGeneratorMojo.java b/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloJsonSchemaGeneratorMojo.java index 59fb1c2a5..1ac8638c4 100644 --- a/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloJsonSchemaGeneratorMojo.java +++ b/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloJsonSchemaGeneratorMojo.java @@ -49,6 +49,10 @@ public final class ModelloJsonSchemaGeneratorMojo extends AbstractModelloGenerat @Parameter(defaultValue = "${project.build.directory}/generated-site/jsonschema", required = true) private File outputDirectory; + /** + * The name of the generated JSON Schema file. If not set, it is + * <model id>-<version>.schema.json. + */ @Parameter private String jsonSchemaFileName; diff --git a/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloXdocMojo.java b/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloXdocMojo.java index bda1f14e0..9140d4a42 100644 --- a/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloXdocMojo.java +++ b/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloXdocMojo.java @@ -46,6 +46,7 @@ public class ModelloXdocMojo extends AbstractModelloGeneratorMojo { private File outputDirectory; /** + * The name of the generated xdoc file. If not set, it is <model id>.xml. * * @since 1.0-alpha-21 */ diff --git a/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloXsdMojo.java b/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloXsdMojo.java index 8fd59b97c..538563f7b 100644 --- a/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloXsdMojo.java +++ b/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloXsdMojo.java @@ -47,15 +47,16 @@ public class ModelloXsdMojo extends AbstractModelloGeneratorMojo { private File outputDirectory; /** - * Boolean flag to enforce mandatory elements in the XML schema. - * If set to {@code false} the XSD won't enforce mandatory elements in the XML which can be useful if the XML is post processed (e.g. POM merging with parents). - * The default value is {@code false} for backwards compatibility reasons, but should be set to {@code true} for most cases. + * Kept for backward compatibility; it no longer has any effect. The generated schema always requires the + * fields that are {@code required} in the model and makes the others optional. * @since 2.1.0 */ @Parameter(defaultValue = "false") private boolean enforceMandatoryElements; /** + * The name of the generated XML Schema file. If not set, it is + * <model id>-<version>.xsd. * * @since 1.0-alpha-21 */ diff --git a/modello-maven-plugin/src/site/markdown/examples/multi-model.md.vm b/modello-maven-plugin/src/site/markdown/examples/multi-model.md similarity index 95% rename from modello-maven-plugin/src/site/markdown/examples/multi-model.md.vm rename to modello-maven-plugin/src/site/markdown/examples/multi-model.md index 67c4dfb41..23c7e682e 100644 --- a/modello-maven-plugin/src/site/markdown/examples/multi-model.md.vm +++ b/modello-maven-plugin/src/site/markdown/examples/multi-model.md @@ -1,9 +1,7 @@ ---- title: Example of multi-model configuration author: - - Denis Cabasson +- Denis Cabasson date: 10 August 2006 ---- # Processing Multiple Modello Models @@ -20,7 +18,6 @@ You can use the following configuration in your `pom.xml` to have the Modello Pl [...] org.codehaus.modello modello-maven-plugin - ${project.version} mdo diff --git a/modello-maven-plugin/src/site/markdown/index.md b/modello-maven-plugin/src/site/markdown/index.md index 2d0171689..d12a54f2c 100644 --- a/modello-maven-plugin/src/site/markdown/index.md +++ b/modello-maven-plugin/src/site/markdown/index.md @@ -14,6 +14,7 @@ This plugin makes use of the [Modello](https://codehaus-plexus.github.io/modello - [modello:xsd](./xsd-mojo.html) Generates an XML Schema from the Modello model. - [modello:xdoc](./xdoc-mojo.html) Generates standard documentation for the Modello model, in xdoc format. +- [modello:jsonschema](./jsonschema-mojo.html) Generates a JSON Schema from the Modello model. - [modello:java](./java-mojo.html) Generates Java beans from the Modello model. - [modello:xpp3-writer](./xpp3-writer-mojo.html) Generates an XML Pull Parser writer from the Modello model. - [modello:xpp3-reader](./xpp3-reader-mojo.html) Generates an XML Pull Parser reader from the Modello model. @@ -23,15 +24,17 @@ This plugin makes use of the [Modello](https://codehaus-plexus.github.io/modello - [modello:dom4j-reader](./dom4j-reader-mojo.html) Generates a DOM4J reader from the Modello model. - [modello:stax-writer](./stax-writer-mojo.html) Generates a StAX writer from the Modello model. - [modello:stax-reader](./stax-reader-mojo.html) Generates a StAX reader from the Modello model. -- [modello:jdom-writer](./jdom-writer-mojo.html) Generates a [jdom](http://www.jdom.org/) writer from the model that is capable of preserving element ordering and comments. +- [modello:jdom-writer](./jdom-writer-mojo.html) Generates a [JDOM](https://www.jdom.org/) writer from the model that is capable of preserving element ordering and comments. +- [modello:sax-writer](./sax-writer-mojo.html) Generates a SAX writer from the Modello model. - [modello:jackson-writer](./jackson-writer-mojo.html) Generates a JSON writer based on Jackson Streaming APIs from the Modello model. - [modello:jackson-reader](./jackson-reader-mojo.html) Generates a JSON reader based on Jackson Streaming APIs from the Modello model. -- [modello:jackson-extended-reader](./jackson-extended-reader-mojo.html) Generates a JSON reader based on Jackson Streaming APIs from the. Modello model that records line/column number metadata in the parsed model. +- [modello:jackson-extended-reader](./jackson-extended-reader-mojo.html) Generates a JSON reader based on Jackson Streaming APIs from the Modello model that records line/column number metadata in the parsed model. - [modello:snakeyaml-writer](./snakeyaml-writer-mojo.html) Generates a YAML writer based on SnakeYaml Streaming APIs from the Modello model. - [modello:snakeyaml-reader](./snakeyaml-reader-mojo.html) Generates a YAML reader based on SnakeYaml Streaming APIs from the Modello model. -- [modello:snakeyaml-extended-reader](./snakeyaml-extended-reader-mojo.html) Generates a YAML reader based on SnakeYaml Streaming APIs from the. Modello model that records line/column number metadata in the parsed model. +- [modello:snakeyaml-extended-reader](./snakeyaml-extended-reader-mojo.html) Generates a YAML reader based on SnakeYaml Streaming APIs from the Modello model that records line/column number metadata in the parsed model. - [modello:velocity](./velocity-mojo.html) Creates files from the model using Velocity templates. - [modello:converters](./converters-mojo.html) Generates classes that can convert between different versions of the model. +- [modello:generate](./generate-mojo.html) Runs the generator named by the `generatorId` parameter, for generators contributed by other Modello plugins. ## Usage diff --git a/modello-maven-plugin/src/site/markdown/usage.md.vm b/modello-maven-plugin/src/site/markdown/usage.md similarity index 97% rename from modello-maven-plugin/src/site/markdown/usage.md.vm rename to modello-maven-plugin/src/site/markdown/usage.md index 914aeeeda..1d9e87f3c 100644 --- a/modello-maven-plugin/src/site/markdown/usage.md.vm +++ b/modello-maven-plugin/src/site/markdown/usage.md @@ -1,9 +1,7 @@ ---- title: Usage author: - - Denis Cabasson +- Denis Cabasson date: 10 August 2006 ---- # Usage @@ -23,7 +21,7 @@ You can use the following configuration in your `pom.xml` to invoke the Modello org.codehaus.modello modello-maven-plugin - ${project.version} + src/main/mdo/myModel.mdo diff --git a/modello-plugins/README.md b/modello-plugins/README.md index 1409c4290..080014be1 100644 --- a/modello-plugins/README.md +++ b/modello-plugins/README.md @@ -23,7 +23,7 @@ That has a consequence worth knowing before you touch anything here: > **Tooling that works from Maven source roots does not see this tree.** Formatters, static analysis, IDE indexing and automated refactoring all skip it, and they skip it -*silently* — a run reports success having read none of these files. A JUnit 4 to JUnit 5 migration hit +*silently* — a run reports success having read none of these files. A test-framework migration hit exactly this: the recipe reported success and had rewritten none of the 29 verifiers. Whatever you are running across the codebase, check afterwards whether it reached this directory, and expect to finish the job by hand. diff --git a/modello-plugins/modello-plugin-dom4j/src/site/markdown/index.md b/modello-plugins/modello-plugin-dom4j/src/site/markdown/index.md index 437c06fe8..14de8449e 100644 --- a/modello-plugins/modello-plugin-dom4j/src/site/markdown/index.md +++ b/modello-plugins/modello-plugin-dom4j/src/site/markdown/index.md @@ -6,9 +6,9 @@ author: # Modello Dom4J Plugin -Modello Dom4J Plugin generates XML readers and writers based on [Dom4J 1 API](http://dom4j.sourceforge.net/dom4j-1.6.1/). +Modello Dom4J Plugin generates XML readers and writers based on [Dom4J 1 API](https://dom4j.github.io/). -Notice: DOM content type is represented as [plexus-utils' Xpp3Dom](http://plexus.codehaus.org/plexus-utils/apidocs/org/codehaus/plexus/util/xml/Xpp3Dom.html) objects +Notice: DOM content type is represented as [plexus-xml's Xpp3Dom](https://codehaus-plexus.github.io/plexus-xml/apidocs/org.codehaus.plexus.util.xml/org/codehaus/plexus/util/xml/Xpp3Dom.html) objects ## dom4j-reader diff --git a/modello-plugins/modello-plugin-jackson/src/site/markdown/index.md b/modello-plugins/modello-plugin-jackson/src/site/markdown/index.md index c9bc14e7b..34bcef9bf 100644 --- a/modello-plugins/modello-plugin-jackson/src/site/markdown/index.md +++ b/modello-plugins/modello-plugin-jackson/src/site/markdown/index.md @@ -6,7 +6,7 @@ author: # Modello Jackson Plugin -Modello Jackson Plugin generates YAML readers and writers based on [Jackson APIs](http://wiki.fasterxml.com/JacksonHome), plus reader delegates to be able to read multiple model versions. +Modello Jackson Plugin generates JSON readers and writers based on [Jackson APIs](https://github.com/FasterXML/jackson), plus reader delegates to be able to read multiple model versions. ## jackson-reader diff --git a/modello-plugins/modello-plugin-jdom/src/site/markdown/index.md b/modello-plugins/modello-plugin-jdom/src/site/markdown/index.md index f4bae2359..efdb1602f 100644 --- a/modello-plugins/modello-plugin-jdom/src/site/markdown/index.md +++ b/modello-plugins/modello-plugin-jdom/src/site/markdown/index.md @@ -6,9 +6,9 @@ author: # Modello JDOM Plugin -Modello JDOM Plugin generates XML writers based on [JDOM 1 API](http://jdom.org/). It attempts to preserve formatting of not changed elements and even with the changed ones it does some tricks to keep the formatting in line with the rest. +Modello JDOM Plugin generates XML writers based on [JDOM 1 API](https://www.jdom.org/). It attempts to preserve formatting of not changed elements and even with the changed ones it does some tricks to keep the formatting in line with the rest. -Notice: DOM content type is represented as [plexus-utils' Xpp3Dom](http://plexus.codehaus.org/plexus-utils/apidocs/org/codehaus/plexus/util/xml/Xpp3Dom.html) objects +Notice: DOM content type is represented as [plexus-xml's Xpp3Dom](https://codehaus-plexus.github.io/plexus-xml/apidocs/org.codehaus.plexus.util.xml/org/codehaus/plexus/util/xml/Xpp3Dom.html) objects ## jdom-writer diff --git a/modello-plugins/modello-plugin-sax/src/site/markdown/index.md b/modello-plugins/modello-plugin-sax/src/site/markdown/index.md index 6d9d8b4a8..caafe0159 100644 --- a/modello-plugins/modello-plugin-sax/src/site/markdown/index.md +++ b/modello-plugins/modello-plugin-sax/src/site/markdown/index.md @@ -6,7 +6,7 @@ author: Simone Tripodi # Modello SAX Plugin Modello SAX Plugin generates SAX writers based on -[SAX APIs](http://docs.oracle.com/javase/1.4.2/docs/api/org/xml/sax/package-summary.html), +[SAX APIs](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/package-summary.html), plus reader delegates to be able to read multiple model versions. ## sax-writer diff --git a/modello-plugins/modello-plugin-stax/src/site/markdown/index.md b/modello-plugins/modello-plugin-stax/src/site/markdown/index.md index 7459aa737..0c7ba8386 100644 --- a/modello-plugins/modello-plugin-stax/src/site/markdown/index.md +++ b/modello-plugins/modello-plugin-stax/src/site/markdown/index.md @@ -6,9 +6,9 @@ author: # Modello StAX Plugin -Modello StAX Plugin generates XML readers and writers based on [StAX API](http://docs.oracle.com/javase/6/docs/api/javax/xml/stream/package-summary.html), plus reader delegates to be able to read multiple model versions. +Modello StAX Plugin generates XML readers and writers based on [StAX API](https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/package-summary.html), plus reader delegates to be able to read multiple model versions. -Notice: DOM content type can be represented either as [plexus-utils' Xpp3Dom](http://plexus.codehaus.org/plexus-utils/apidocs/org/codehaus/plexus/util/xml/Xpp3Dom.html) or, since Modello 1.6, standard [org.w3c.dom.Element](http://docs.oracle.com/javase/1.4.2/docs/api/org/w3c/dom/Element.html) objects +Notice: DOM content type can be represented either as [plexus-xml's Xpp3Dom](https://codehaus-plexus.github.io/plexus-xml/apidocs/org.codehaus.plexus.util.xml/org/codehaus/plexus/util/xml/Xpp3Dom.html) or, since Modello 1.6, standard [org.w3c.dom.Element](https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html) objects ## stax-reader @@ -37,6 +37,8 @@ In addition, if multiple model reader versions are generated (each in its own pa Depending on the model version found in the XML content, the returned `Object` will be of the right version package. +By default the generated reader checks that the model version of the document matches the version of the reader. This applies only to models with a `versionDefinition`. Set the `versionCheck` parameter of the `stax-reader` goal (property `modello.stax.versionCheck`) to `false` to turn the check off. + ## stax-writer `stax-writer` generator creates `my.model.package.io.stax.ModelNameStaxWriter` class with following public methods: diff --git a/modello-plugins/modello-plugin-xpp3/src/site/markdown/index.md b/modello-plugins/modello-plugin-xpp3/src/site/markdown/index.md index e683117ed..005ffef36 100644 --- a/modello-plugins/modello-plugin-xpp3/src/site/markdown/index.md +++ b/modello-plugins/modello-plugin-xpp3/src/site/markdown/index.md @@ -6,9 +6,9 @@ author: # Modello XPP3 Plugin -Modello XPP3 Plugin generates XML readers and writers based on XPP3 API (XML Pull Parser) provided by [plexus-utils](http://plexus.codehaus.org/plexus-utils/). +Modello XPP3 Plugin generates XML readers and writers based on XPP3 API (XML Pull Parser) provided by [plexus-utils](https://codehaus-plexus.github.io/plexus-utils/). -Notice: DOM content type can be represented either as [plexus-utils' Xpp3Dom](http://plexus.codehaus.org/plexus-utils/apidocs/org/codehaus/plexus/util/xml/Xpp3Dom.html) or, since Modello 1.6, standard [org.w3c.dom.Element](http://docs.oracle.com/javase/1.4.2/docs/api/org/w3c/dom/Element.html) objects +Notice: DOM content type can be represented either as [plexus-xml's Xpp3Dom](https://codehaus-plexus.github.io/plexus-xml/apidocs/org.codehaus.plexus.util.xml/org/codehaus/plexus/util/xml/Xpp3Dom.html) or, since Modello 1.6, standard [org.w3c.dom.Element](http://docs.oracle.com/javase/1.4.2/docs/api/org/w3c/dom/Element.html) objects ## xpp3-reader diff --git a/modello-plugins/modello-plugin-xsd/src/site/markdown/index.md b/modello-plugins/modello-plugin-xsd/src/site/markdown/index.md new file mode 100644 index 000000000..22cad3ac2 --- /dev/null +++ b/modello-plugins/modello-plugin-xsd/src/site/markdown/index.md @@ -0,0 +1,42 @@ +--- +title: Modello XSD Plugin +--- + +# Modello XSD Plugin + +Modello XSD Plugin generates an XML Schema from the model, with the `xsd` goal of the Modello Maven plugin. +Fields that are `required` in the model are required in the schema, and the others are optional. + +## Constraining a String field + +Three field attributes add a constraint to the schema type of a `String` field. They are mutually exclusive: +a field that sets more than one of them fails the build. + +| Field attribute | Generated schema | +|:-------------------|:---------------------------------------------------------------------------------------------------------------------------| +| `xsd.enumerations` | A restriction of `xs:string` with one `xs:enumeration` per value: other values are rejected. | +| `xsd.suggestions` | A union of a fixed enumeration and plain `xs:string`: editors can complete the listed values, but any value is still valid. | +| `xsd.pattern` | A restriction of `xs:string` with an `xs:pattern` facet. | + +The values of `xsd.enumerations` and `xsd.suggestions` are separated by commas. + +```xml + + scope + 1.0.0+ + String + The dependency scope. + + + + artifactId + 1.0.0+ + String + The artifact identifier. + +``` + +## Mixed content + +When a class has an element field with `xml.format="mixed"` and no `xml.tagName`, the schema type of +the class is generated with `mixed="true"`, so that it accepts both text and child elements. diff --git a/src/site/markdown/release-notes.md b/src/site/markdown/release-notes.md index 01121bb74..bb93c0409 100644 --- a/src/site/markdown/release-notes.md +++ b/src/site/markdown/release-notes.md @@ -25,7 +25,7 @@ Restored maven 2.2.1 compatibility that was broken in 1.8 ## 1.8 Release Notes (2013-08-06) -The [full list of changes](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=19102) can be found in our [issue management system](./issue-management.html), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -47,7 +47,7 @@ The [full list of changes](http://jira.codehaus.org/secure/ReleaseNote.jspa?proj ## 1.7 Release Notes (2013-02-19) -The [full list of changes](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=18979) can be found in our [issue management system](./issue-management.html), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -60,7 +60,7 @@ The [full list of changes](http://jira.codehaus.org/secure/ReleaseNote.jspa?proj ## 1.6 Release Notes (2012-11) -The [full list of changes](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=18746) can be found in our [issue management system](./issue-management.html), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -81,7 +81,7 @@ The [full list of changes](http://jira.codehaus.org/secure/ReleaseNote.jspa?proj ## 1.5 Release Notes (2011-05-30) -The [full list of changes](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=16405) can be found in our [issue management system](./issue-management.html), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -94,7 +94,7 @@ The [full list of changes](http://jira.codehaus.org/secure/ReleaseNote.jspa?proj ## 1.4.1 Release Notes (2010-09-25) -The [full list of changes](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=16774) can be found in our [issue management system](./issue-management.html), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -102,7 +102,7 @@ The [full list of changes](http://jira.codehaus.org/secure/ReleaseNote.jspa?proj ## 1.4 Release Notes (2010-05-29) -The [full list of changes](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=16153) can be found in our [issue management system](./issue-management.html), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -129,7 +129,7 @@ The [full list of changes](http://jira.codehaus.org/secure/ReleaseNote.jspa?proj ## 1.3 Release Notes (2010-04-01) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=15584), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -154,7 +154,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.2 Release Notes (2010-01-19) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=15583), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -169,7 +169,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.1 Release Notes (2009-08-21) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=14908), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -196,7 +196,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.0.2 Release Notes (2009-06-11) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=15080), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -211,7 +211,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.0.1 Release Notes (2009-03-09) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=14892), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -241,7 +241,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.0 Release Notes (2009-01-29) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=13956), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -294,7 +294,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.0-alpha-22 Release Notes (2008-12-12) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=14742), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -320,7 +320,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.0-alpha-21 Release Notes (2008-08-06) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=14469), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -338,7 +338,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.0-alpha-20 Release Notes (2008-07-25) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=14466), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -346,7 +346,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.0-alpha-19 Release Notes (2008-07-14) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=14339), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -368,7 +368,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.0-alpha-18 Release Notes (2008-01-15) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=13717), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -392,7 +392,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.0-alpha-17 Release Notes (2007-07-30) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=13637), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -401,7 +401,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.0-alpha-15 Release Notes (2007-03-23) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=13272), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -414,7 +414,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.0-alpha-14 Release Notes (2007-02-20) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=13068), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -437,7 +437,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.0-alpha-13 Release Notes (2006-12-07) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=12956), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug @@ -453,7 +453,7 @@ The full list of changes can be found in our [issue management system](http://ji ## 1.0-alpha-11 Release Notes (2006-09-20) -The full list of changes can be found in our [issue management system](http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10510&version=12790), and is reproduced below. +The full list of changes can be found in our [issue management system](./issue-management.html), and is reproduced below. ### Bug