This repository contains the ORD Maven project, which generates Java annotations and models from the Open Resource Discovery (ORD) specification.
Generation, build, and continuous integration (CI) are fully automated via GitHub Actions.
ORD Maven provides:
- Annotation generation via the TypeScript script in
tools/annotation-gen/src/generateAnnotations.ts. - Model generation from
Document.schema.json. - Modular packaging as
ord-annotationsandord-models. - Automated PR updates through GitHub Actions.
This enables Java projects to consume up-to-date annotations and models directly from the ORD specification.
- Java 11+ (JDK)
- Maven 3.9+
- Node.js 18+ (for code generation)
Clone the repo and run:
git clone https://github.com/open-resource-discovery/ord-maven.git
cd ord-maven
mvn clean installThis will:
- Run the code generator (tools/annotation-gen) against the ORD specification.
- Build and install the modules ord-annotations and ord-models into your local Maven repository.
To include the generated artifacts in your Maven project, add the following dependencies:
<dependencies>
<dependency>
<groupId>org.openresourcediscovery</groupId>
<artifactId>ord-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.openresourcediscovery</groupId>
<artifactId>ord-models</artifactId>
</dependency>
</dependencies>You also need to configure the repository:
<repositories>
<repository>
<id>central</id>
<name>Maven Central Repository</name>
<url>https://repo.maven.apache.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>This repository uses GitHub Actions to keep the generated code in sync with the upstream ORD specification.
The CI pipeline runs on each push to main and nightly via a scheduled job. It performs the following steps:
- Checkout both this repository and the upstream
specificationrepo. - Verify the presence of the annotated schema (
Document.annotated.schema.json). - Generate Java annotation interfaces using the custom generator script (
tools/annotation-gen/src/generateAnnotations.ts). - Generate Java models (POJOs) from the specification schemas.
- Build all Maven modules with Java 11 + Maven 3.9.
- Open a Pull Request with the regenerated code (
annotations/andmodels/), which is auto-merged if checks pass.
This ensures that the published artifacts always reflect the latest version of the ORD specification without requiring manual updates.
This project is licensed under the Apache License 2.0.