Skip to content

open-resource-discovery/ord-maven

ORD Maven

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.


Overview

ORD Maven provides:

  1. Annotation generation via the TypeScript script in tools/annotation-gen/src/generateAnnotations.ts.
  2. Model generation from Document.schema.json.
  3. Modular packaging as ord-annotations and ord-models.
  4. Automated PR updates through GitHub Actions.

This enables Java projects to consume up-to-date annotations and models directly from the ORD specification.

Prerequisites

  • Java 11+ (JDK)
  • Maven 3.9+
  • Node.js 18+ (for code generation)

Build & Usage (Local)

Clone the repo and run:

git clone https://github.com/open-resource-discovery/ord-maven.git
cd ord-maven
mvn clean install

This 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.

Using as Dependency

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>

Continuous Integration (CI)

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:

  1. Checkout both this repository and the upstream specification repo.
  2. Verify the presence of the annotated schema (Document.annotated.schema.json).
  3. Generate Java annotation interfaces using the custom generator script (tools/annotation-gen/src/generateAnnotations.ts).
  4. Generate Java models (POJOs) from the specification schemas.
  5. Build all Maven modules with Java 11 + Maven 3.9.
  6. Open a Pull Request with the regenerated code (annotations/ and models/), 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.

License

This project is licensed under the Apache License 2.0.

About

Provides annotations and data models for the Open Resource Discovery Java plugin, automatically generated from the ORD specification.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors