Skip to content
Open
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 .github/workflows/java-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Java CI

on:
push:
paths:
- 'converters/java/**'
- 'core-spec/**'
- '.github/workflows/java-ci.yml'
pull_request:
paths:
- 'converters/java/**'
- 'core-spec/**'
- '.github/workflows/java-ci.yml'

jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-latest
defaults:
run:
working-directory: converters/java

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
cache: maven
cache-dependency-path: 'converters/java/**/pom.xml'

- name: Maven verify
run: mvn --batch-mode --no-transfer-progress clean verify
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
**/htmlcov/
**/dist/
**/target/
**/.idea/

# Go CLI
cli/dist/
Expand Down
4 changes: 2 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ Broad ecosystem adoption depends on practical tools that let teams validate thei
- [Validation Script (validate.py)](validation/validate.py) — validates Ossie YAML against JSON Schema, unique names, references, and SQL syntax
- [Snowflake Converter](converters/snowflake/) — Ossie → Snowflake Cortex Analyst YAML converter
- [GoodData Converter](converters/gooddata/) — bidirectional Ossie ↔ GoodData LDM converter
- [Salesforce Converter](converters/salesforce/) — Ossie ↔ Salesforce converter
- [Apache Polaris Converter](converters/polaris/) — Ossie → Apache Polaris converter
- [Salesforce Converter](converters/java/salesforce/) — Ossie ↔ Salesforce converter
- [Apache Polaris Converter](converters/java/polaris/) — Ossie → Apache Polaris converter
- [OrionBelt Converter](converters/orionbelt/) — bidirectional Ossie ↔ OrionBelt OBML converter

**Related Issues:**
Expand Down
6 changes: 6 additions & 0 deletions converters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@

An Ossie Converter translates between the Ossie semantic model format and a specific vendor's semantic implementation. This enables teams to author a semantic model once in the Ossie standard and then generate the corresponding vendor-specific representation automatically.

Java converters can reuse the schema-derived POJOs provided by the
[`ossie-common`](java/ossie-common/) Maven module. Its model classes are generated
from the canonical core specification during each Maven build.
All Java modules are grouped in the [`java`](java/) Maven reactor; non-Java
converters keep their existing top-level layout.

## Hub-and-Spoke Model

Ossie converters follow a **hub-and-spoke** architecture:
Expand Down
46 changes: 46 additions & 0 deletions converters/java/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# Apache Ossie Java Converters

This Maven reactor contains the shared schema-generated Java model and all Java
converters:

- `ossie-common` generates `org.apache.ossie.model` from the canonical Ossie
JSON Schema.
- `polaris` consumes those model classes directly for YAML parsing, generation,
import, and export.
- `salesforce` uses those model classes at its Ossie input and output boundaries
while retaining its dynamic vendor-mapping pipeline internally.

## Build

Java 17 or newer and Maven 3.9.12 or newer are required to build the reactor.

```bash
cd converters/java
mvn clean verify
```

Build one converter together with its required modules using `-am`:

```bash
mvn -pl polaris -am clean package
mvn -pl salesforce -am clean package
```
59 changes: 59 additions & 0 deletions converters/java/ossie-common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# Apache Ossie Common

This Java module generates Jackson-compatible POJOs from the canonical
[`core-spec/osi-schema.json`](../../../core-spec/osi-schema.json) with
`jsonschema2pojo-maven-plugin`. Generated sources are written under `target/`
and are not checked into source control.

## Build

Java 17 or newer and Maven 3.9.12 or newer are required by the code-generation
plugin. The generated artifact targets Java 11 so it can be shared by the
existing Java converters.

```bash
mvn clean verify
```

The generated model classes use the `org.apache.ossie.model` package. Install
the artifact into the local Maven repository for use by another converter:

```bash
mvn install
```

```xml
<dependency>
<groupId>org.apache.ossie</groupId>
<artifactId>ossie-common</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
```

## Validation boundary

The generated classes are transport POJOs, not a JSON Schema validator.
Constraints such as `required`, `const`, and `minItems` must be checked against
the canonical schema before deserialization. In particular, `ai_context` is
generated as `Object` because its schema accepts either a string or a structured
object and `jsonschema2pojo` does not generate a typed `oneOf` union. Consumers
should validate input first and then handle this value as `String` or `Map`.
121 changes: 121 additions & 0 deletions converters/java/ossie-common/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.ossie</groupId>
<artifactId>ossie-java-converters</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>ossie-common</artifactId>
<packaging>jar</packaging>

<name>Apache Ossie Common</name>
<description>Generated Java model for the Apache Ossie core metadata specification</description>

<properties>
<!-- Build with JDK 17 for jsonschema2pojo, but keep the model usable by Java 11 converters. -->
<maven.compiler.release>11</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<jackson.version>2.18.9</jackson.version>
<jsonschema2pojo.version>1.3.3</jsonschema2pojo.version>
<junit.version>5.11.4</junit.version>
</properties>

<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>${jsonschema2pojo.version}</version>
<executions>
<execution>
<id>generate-osi-model</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<sourceDirectory>${project.basedir}/../../../core-spec</sourceDirectory>
<includes>
<include>osi-schema.json</include>
</includes>
<sourceType>jsonschema</sourceType>
<targetPackage>org.apache.ossie.model</targetPackage>
<removeOldOutput>true</removeOldOutput>
<targetVersion>11</targetVersion>
<annotationStyle>jackson2</annotationStyle>
<includeGeneratedAnnotation>true</includeGeneratedAnnotation>
<includeHashcodeAndEquals>true</includeHashcodeAndEquals>
<includeToString>true</includeToString>
<initializeCollections>true</initializeCollections>
</configuration>
</execution>
</executions>
</plugin>

<!-- License header check (Apache RAT); version inherited from the ASF parent POM -->
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<consoleOutput>true</consoleOutput>
<excludes>
<exclude>**/target/**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading
Loading