Skip to content

Commit

Permalink
updated dependencies/plugins; plus junit updates (#173)
Browse files Browse the repository at this point in the history
* updated dependencies/plugins; plus junit updates

* Java 8 doesn't build in Github due to a dependency.  Use 11 instead.

* @disabled ignored without plugin
  • Loading branch information
cweedall authored Apr 15, 2024
1 parent bcb8835 commit 306efa6
Show file tree
Hide file tree
Showing 10 changed files with 214 additions and 184 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
java: [ '8', '11', '13', '15' ]
java: ["11", "17", "21"]
name: Java ${{ matrix.Java }}
steps:
- uses: actions/checkout@v3
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
distribution: "adopt"
java-version: ${{ matrix.java }}
- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn -B package --file pom.xml
- name: Test with Maven
run: mvn -B test --file pom.xml
run: mvn -B test --file pom.xml
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

OBA reads ontologies (OWL) and generates an OpenAPI Specification (OAS). Using this definition, OBA creates a REST API server automatically.

![Diagram](docs/figures/oba.svg)
![Diagram](docs/figures/oba.svg)

## Quickstart

Expand All @@ -11,6 +11,11 @@ There are two option to run OBA:
1. Download the binary.
2. Build the binary from the repository.

### Pre-requisites

Due to recent versions of the OpenAPI generator being built with Java 11, you will need Java 11 or higher to run OBA v3.7.0. The current recommended distribution of Java 11+ JDKs (and "JREs") is at [Adoptium's releases page](https://adoptium.net/temurin/releases/?version=11).

Java versions higher than 11 are also available to use. Java 11 is simply the minimum version.

### Downloading binary

Expand All @@ -37,6 +42,7 @@ Congratulations! You have generated an Open Api Specification.
For instructions on using OBA to create your API server, go to the [documentation](https://oba.readthedocs.io/en/latest/)

## Citation

Please cite our work as follows:

```
Expand Down
111 changes: 65 additions & 46 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,97 +6,107 @@
<packaging>jar</packaging>
<groupId>edu.isi.oba</groupId>
<artifactId>oba</artifactId>
<version>3.6.1</version>
<version>3.7.0</version>
<name>core</name>
<url>https://github.com/KnowledgeCaptureAndDiscovery/OBA</url>


<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jdk.version>1.8</jdk.version>
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
<maven.compiler.release>11</maven.compiler.release>
<jdk.version>11</jdk.version>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-shade-plugin -->
<maven-shade-plugin.version>3.5.2</maven-shade-plugin.version>
</properties>

<dependencies>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20190722</version>
<version>20240303</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
<groupId>com.github.jsonld-java</groupId>
<artifactId>jsonld-java</artifactId>
<version>0.11.1</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.2</version>
<scope>test</scope>
</dependency>


<!-- logging (Removed because it's not used) -->
<!-- https://mvnrepository.com/artifact/org.slf4j/jcl-over-slf4j -->
<!--
<!-- https://mvnrepository.com/artifact/io.swagger/swagger-compat-spec-parser -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<groupId>io.swagger</groupId>
<artifactId>swagger-compat-spec-parser</artifactId>
<version>1.0.70</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.swagger.core.v3/swagger-models -->
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-models</artifactId>
<version>2.2.21</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.swagger.parser.v3/swagger-parser -->
<dependency>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser</artifactId>
<version>2.1.21</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.swagger.parser.v3/swagger-parser-core -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.28</version>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser-core</artifactId>
<version>2.1.21</version>
</dependency>
-->

<!-- https://mvnrepository.com/artifact/org.openapitools/openapi-generator -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator</artifactId>
<version>7.4.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/net.sourceforge.owlapi/owlapi-api -->
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-api</artifactId>
<version>5.1.10</version>
<version>5.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.sourceforge.owlapi/owlapi-apibinding -->
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-apibinding</artifactId>
<version>5.1.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openapitools/openapi-generator -->
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator</artifactId>
<version>4.0.0</version>
<!-- <version>4.3.1</version>-->
<version>5.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.sourceforge.owlapi/owlapi-impl -->
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-compatibility</artifactId>
<version>5.1.10</version>
<artifactId>owlapi-impl</artifactId>
<version>5.5.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.yaml/snakeyaml -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.25</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-dependency-plugin -->
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<version>2.2</version>
</dependency>

<!-- https://mvnrepository.com/artifact/commons-cli/commons-cli -->
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.3.1</version>
<version>1.6.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<!-- "Unused dependency" - but it is called via SerializerUtils from org.openapitools/openapi-generator and throws an error if not included explicitly -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.17.0</version>
</dependency>
</dependencies>

<build>
Expand All @@ -106,26 +116,35 @@
</resource>
</resources>
<plugins>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-eclipse-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<version>2.10</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
</configuration>
</plugin>

<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.13.0</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>

<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
</plugin>

<!-- Make this jar executable -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
Expand Down
31 changes: 18 additions & 13 deletions src/main/java/edu/isi/oba/ObaUtils.java
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
package edu.isi.oba;

import static edu.isi.oba.Oba.logger;
import edu.isi.oba.config.YamlConfig;
import org.apache.commons.cli.*;
import org.json.JSONException;
import org.json.JSONObject;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;

import java.io.*;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.logging.Level;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

import static edu.isi.oba.Oba.logger;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.logging.Level;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

import org.apache.commons.cli.*;

import org.json.JSONException;
import org.json.JSONObject;

import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLAnnotation;
import org.semanticweb.owlapi.model.OWLEntity;
import org.semanticweb.owlapi.model.OWLLiteral;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.search.EntitySearcher;

import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;

import uk.ac.manchester.cs.owl.owlapi.OWLAnnotationPropertyImpl;

public class ObaUtils {
Expand Down Expand Up @@ -180,7 +185,7 @@ public static String get_config_yaml(String[] args) {
}

public static YamlConfig get_yaml_data(String config_yaml) {
Constructor constructor = new Constructor(YamlConfig.class);
Constructor constructor = new Constructor(YamlConfig.class, new LoaderOptions());
Yaml yaml = new Yaml(constructor);

InputStream config_input = null;
Expand Down
13 changes: 5 additions & 8 deletions src/main/java/edu/isi/oba/Serializer.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
package edu.isi.oba;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.*;

import io.swagger.parser.OpenAPIParser;
import io.swagger.v3.oas.models.*;
import io.swagger.v3.oas.models.security.SecurityScheme;

import io.swagger.v3.parser.core.models.ParseOptions;
import io.swagger.v3.parser.core.models.SwaggerParseResult;
import org.openapitools.codegen.serializer.SerializerUtils;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.util.*;
import org.openapitools.codegen.serializer.SerializerUtils;

class Serializer {
//TODO: validate the yaml
Expand Down
Loading

0 comments on commit 306efa6

Please sign in to comment.