From adf8dcf7dc758b9e0f5adb939ffe95a0b7c8714a Mon Sep 17 00:00:00 2001 From: Andrii Berezovskyi Date: Mon, 5 Oct 2026 13:09:03 +0200 Subject: [PATCH 1/3] Align PROMCODE build, tests, containers and CI --- .dockerignore | 18 +- .editorconfig | 24 +++ .github/workflows/docker.yml | 49 ++--- .github/workflows/maven-acceptance-manual.yml | 65 +++--- .github/workflows/maven.yml | 58 ++---- .gitignore | 3 + AGENTS.md | 10 +- CONTRIBUTING.md | 5 +- DEVELOPMENT.md | 59 +++--- Dockerfile | 8 +- README.md | 53 +++-- docker-compose.yml | 12 +- promcode-lyo-server/pom.xml | 189 +++++++++++++++--- .../src/main/resources/logback.xml | 6 + .../server/testing/OslcTestSupport.java | 93 +++++++++ .../server/testing/PromcodeRdfTest.java | 52 +++++ .../server/testing/PromcodeRdfTest.ss | 6 + .../server/testing/SnapshotUtils.java | 168 ++++++++++++++++ .../server/testing/StoreEndpointTest.java | 48 +++++ 19 files changed, 710 insertions(+), 216 deletions(-) create mode 100644 .editorconfig create mode 100644 promcode-lyo-server/src/main/resources/logback.xml create mode 100644 promcode-lyo-server/src/test/java/org/oasis/oslc/promcode/server/testing/OslcTestSupport.java create mode 100644 promcode-lyo-server/src/test/java/org/oasis/oslc/promcode/server/testing/PromcodeRdfTest.java create mode 100644 promcode-lyo-server/src/test/java/org/oasis/oslc/promcode/server/testing/PromcodeRdfTest.ss create mode 100644 promcode-lyo-server/src/test/java/org/oasis/oslc/promcode/server/testing/SnapshotUtils.java create mode 100644 promcode-lyo-server/src/test/java/org/oasis/oslc/promcode/server/testing/StoreEndpointTest.java diff --git a/.dockerignore b/.dockerignore index 7c5e1eb..1c055df 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,28 +1,14 @@ -# Git .git .gitignore - -# Docker Dockerfile docker-compose.yml .dockerignore - -# Documentation README.md *.md - -# IDE .vscode .idea *.iml - -# OS .DS_Store Thumbs.db - -# Target directories -*/target/ -target/ - -# Logs -*.log +**/target +**/*.log diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..93f5fa4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,24 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 4 + +[*.{yml,yaml,json}] +indent_size = 2 + +[promcode-lyo-server/src/test/java/**.java] +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false + +[*.{xml,aird}] +trim_trailing_whitespace = false + +[promcode-lyo-server-model/**] +indent_size = 2 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 69fb32f..97c85b2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: "Docker Build and Push (PROMCODE Server)" on: push: - branches: [main, master] + branches: [main] paths: - 'promcode-lyo-server/**' - 'promcode-lyo-server-model/**' @@ -20,29 +20,30 @@ env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} +permissions: + contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + jobs: build-and-push: + name: Publish server image + if: github.repository == 'OSLC/promcode-lyo-server' && (github.ref == 'refs/heads/main' || github.event_name == 'release') runs-on: ubuntu-latest + timeout-minutes: 40 permissions: contents: read - packages: write + packages: write # Push the built server image to GHCR. steps: - name: Checkout repository - uses: actions/checkout@v4 - - - name: Check build trigger - run: | - if [ "${{ github.event_name }}" = "schedule" ]; then - echo "🔄 This is a scheduled weekly rebuild to update base images" - elif [ "${{ github.event_name }}" = "release" ]; then - echo "🚀 This is a release build" - else - echo "📦 This is a regular build triggered by push" - fi + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 + with: + persist-credentials: false - name: Log in to Container Registry - uses: docker/login-action@v3 + uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -50,11 +51,11 @@ jobs: - name: Extract metadata id: meta - uses: docker/metadata-action@v5 + uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - # For pushes to master/main branch or scheduled builds, tag as "latest" + # For pushes to main branch or scheduled builds, tag as "latest" type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || github.event_name == 'schedule' }} # For releases, create semantic version tags type=semver,pattern={{version}} @@ -64,11 +65,14 @@ jobs: org.opencontainers.image.title=PROMCODE Server org.opencontainers.image.description=A demonstration server for OSLC toolchain management of PROject Management of COntracted DElivery + - name: Set up QEMU + uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3 + - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 with: context: . file: ./Dockerfile @@ -76,15 +80,6 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max # For scheduled builds, don't use cache to ensure fresh base images no-cache: ${{ github.event_name == 'schedule' }} pull: true - - - name: Output image details - run: | - echo "Image has been pushed to:" - echo "${{ steps.meta.outputs.tags }}" | while read -r tag; do - echo " - $tag" - done diff --git a/.github/workflows/maven-acceptance-manual.yml b/.github/workflows/maven-acceptance-manual.yml index eceb696..bfa8435 100644 --- a/.github/workflows/maven-acceptance-manual.yml +++ b/.github/workflows/maven-acceptance-manual.yml @@ -1,57 +1,44 @@ name: Acceptance test (Lyo HEAD) -run-name: "acceptance@${{ github.ref_name }} (Lyo@${{ github.event.inputs.lyoBranch }}; comment: ${{ inputs.comment }})" - - +run-name: "acceptance@${{ github.ref_name }} (Lyo@${{ inputs.lyoBranch }}; ${{ inputs.link }})" on: workflow_dispatch: inputs: lyoBranch: - description: 'Lyo branch to test on' + description: Lyo branch to test on required: true - default: 'master' + default: main lyoRepo: - description: 'Lyo repository or fork' + description: Lyo repository or fork required: true - default: 'eclipse/lyo' + default: eclipse-lyo/lyo link: - description: 'PR/issue link (e.g., to Lyo)' - + description: PR/issue link +permissions: + contents: read concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.lyoRepo }}-${{ github.event.inputs.lyoBranch }} - cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }} - + group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.lyoRepo }}-${{ inputs.lyoBranch }} + cancel-in-progress: true jobs: - build-jdk17: + build: + name: Lyo HEAD compatibility runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: -# java-version: [17] -# # distribution: ['temurin', 'zulu', 'oracle', 'corretto', 'microsoft', 'liberica'] -# distribution: ['temurin'] - include: - - java-version: '21' - distribution: 'temurin' - - java-version: '25' - distribution: 'liberica' - - java-version: '27' - distribution: 'liberica' + timeout-minutes: 30 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 with: - repository: "${{ github.event.inputs.lyoRepo }}" - ref: "${{ github.event.inputs.lyoBranch }}" + repository: ${{ inputs.lyoRepo }} + ref: ${{ inputs.lyoBranch }} path: lyo-trunk - - uses: actions/checkout@v6 + persist-credentials: false + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 with: path: main - - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v4 + persist-credentials: false + - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 with: - distribution: ${{ matrix.distribution }} - java-version: ${{ matrix.java-version }} - - name: 'Maven build (Lyo)' - run: mvn -B clean install --file lyo-trunk/pom.xml -DskipTests -Dmaven.javadoc.skip=true -P '!spotless' -P'!spotbugs' - - name: 'Maven build (project)' - run: | - mvn -B clean verify --file main/promcode-lyo-server/pom.xml + distribution: temurin + java-version: '25' + - name: Maven build (Lyo) + run: mvn -B --no-transfer-progress clean install --file lyo-trunk/pom.xml -DskipTests -Dmaven.javadoc.skip=true -P '!spotless,!spotbugs' + - name: Maven verify (project) + run: mvn -B --no-transfer-progress clean verify -Dselfie=readonly --file main/promcode-lyo-server/pom.xml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 6c743ef..2d4c439 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,57 +1,31 @@ name: CI - on: merge_group: + types: [checks_requested] push: - branches: [main, master] + branches: [main] pull_request: - branches: [main, master] + branches: [main] schedule: - - cron: "19 4 * * 4" # catch SNAPSHOT breaking changes + - cron: "19 4 * * 4" workflow_dispatch: - +permissions: + contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }} - + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: build: + name: build runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - # jdk: ['17', '21'] - # distribution: ['temurin'] - # experimental: [false] - include: - - jdk: '21' - distribution: 'temurin' - experimental: false - - jdk: '25' - distribution: 'temurin' - experimental: false - - jdk: '27' - distribution: 'liberica' - experimental: false - # - jdk: '25-ea' - # distribution: 'zulu' - # experimental: true - continue-on-error: ${{ matrix.experimental }} - + timeout-minutes: 20 steps: - - uses: actions/checkout@v4 - - name: Set up JDK ${{ matrix.jdk }} - uses: actions/setup-java@v4 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 with: - distribution: ${{ matrix.distribution }} - java-version: ${{ matrix.jdk }} - - uses: actions/cache@v4 + persist-credentials: false + - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - - name: 'Maven build' - run: | - mvn -B clean verify --file ./promcode-lyo-server/pom.xml + distribution: temurin + java-version: '25' + - name: Maven verify + run: mvn -B --no-transfer-progress clean verify -Dselfie=readonly --file promcode-lyo-server/pom.xml diff --git a/.gitignore b/.gitignore index 524f096..80e266a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* replay_pid* + +# Maven build output +**/target/ diff --git a/AGENTS.md b/AGENTS.md index 55807c0..e27d028 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,8 +1,8 @@ # AGENTS.md — OSLC PROMCODE Server -Follow human-facing docs: `DEVELOPMENT.md` (build/run) and `CONTRIBUTING.md` (rules). - -Agent-specific notes: - -- `promcode-server` has **no automated tests**; `mvn test` is a compile check only. +Follow [DEVELOPMENT.md](DEVELOPMENT.md) and [CONTRIBUTING.md](CONTRIBUTING.md). +- Run `mvn test -Dselfie=readonly` in `promcode-lyo-server/` for the default check. +- Preserve Lyo Designer user-code guards; do not rewrite generated Java outside them. +- Prefer Java text blocks for multiline RDF payloads. +- Run container smoke checks only when Docker or Podman is available. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 93270d1..ce7e3da 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,9 +9,12 @@ This server is generated from a Lyo Designer model (`promcode-lyo-server-model`) Prefer making model changes in Lyo Designer to preserve traceability between the model and the generated code. +Edit generated Java only inside its user-code guards; change the model when +changing generated resource types, services, or routing. + ## Before you submit -- `mvn test` should build the module (it has no automated tests yet). +- `mvn clean verify -Dselfie=readonly` must pass in `promcode-lyo-server/`. - Keep `DEVELOPMENT.md` and `AGENTS.md` in sync when the build/test setup changes. - Keep CI configuration and `DEVELOPMENT.md` in sync for any significant changes. diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index eaf81b6..6227111 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -1,36 +1,49 @@ # Development — OSLC PROMCODE Server -A sample **OSLC PROMCODE 1.0** server, modelled and generated with -[Lyo Designer](https://oslc.github.io/developing-oslc-applications/eclipse_lyo/lyo-designer.html). -The single Maven module is `promcode-lyo-server/` (a WAR). +The Maven WAR module is `promcode-lyo-server/`; its Lyo Designer model is in +`promcode-lyo-server-model/`. Use JDK 25 and Maven 3.9 or newer. -## Prerequisites -- JDK 21 (25 recommended) -- Maven 3.9 -- (Optional) Docker / Docker Compose, for running the server and its Fuseki store +## Build and tests -## Building +From `promcode-lyo-server/`: - cd promcode-lyo-server - mvn test +```sh +mvn test -Dselfie=readonly +mvn clean verify -Dselfie=readonly +``` -The module currently has **no automated tests**; `mvn test` is a compile check. +JUnit 6 tests check PROMCODE Artifact RDF round trips, resource URI encoding, +and the StorePool SPARQL HTTP endpoint using an embedded MockServer. They require +neither Docker nor an external Fuseki server. Selfie snapshots are checked into +test sources; after an intentional representation change, use `-Dselfie=overwrite` +and review the `.ss` diff before committing. -## Running the server +`verify` also checks test formatting with Spotless. Use `mvn spotless:apply` to +format tests. Generated main sources are excluded from automatic formatting. +Run `mvn verify -Pspotbugs` for static analysis and +`mvn rewrite:dryRun -Prewrite` to preview Java/logging recipe changes in test code. +SpotBugs currently reports `NM_SAME_SIMPLE_NAME_AS_SUPERCLASS` for the generated +`servlet.Application` class extending `jakarta.ws.rs.core.Application`; that +profile fails until the generator's class naming is changed. -The server needs an RDF store (Apache Jena Fuseki). See `README.md` for the full -Fuseki setup. Quick options: +The optional **Acceptance test (Lyo HEAD)** workflow builds a selected upstream +Lyo branch and then verifies this server against the locally installed artifacts. +Its default is `eclipse-lyo/lyo`, branch `main`. - # built-in Jetty - cd promcode-lyo-server && mvn clean jetty:run-war +## Running and configuration - # Tomcat via Maven Cargo - mvn clean cargo:run +See [README startup instructions](README.md#running-the-oslc-promcode-server) +for Fuseki setup and server launch commands. Compose builds the root Dockerfile; +the publication workflow pushes the same server image to GHCR for amd64 and arm64. - # Docker Compose (server + Fuseki together) - docker-compose up --build +Logging uses SLF4J with `src/main/resources/logback.xml`. Set package log levels +there when diagnosing requests. Store connection defaults live in +`src/main/resources/store.properties`; the `LYO_STORE_*` environment variables +override them. -Then open http://localhost:8080/promcode-server/ (Fuseki on :3030). +## Generated build configuration -> Docker here is for **deployment**, not tests — this repo has no Docker-based -> automated tests. +Keep additions inside Lyo Designer user-code guards. After regeneration, check +the Java 25 compiler target, Logback binding, Tomcat installer configuration, +and pinned plugin versions in `pom.xml`: those existing generated sections may +be replaced by generator defaults. Do not format generated Java boilerplate. diff --git a/Dockerfile b/Dockerfile index 44ba2f3..03303b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/library/maven:3-eclipse-temurin-21-alpine AS build +FROM docker.io/library/maven:3-eclipse-temurin-25-alpine AS build WORKDIR /src # Copy pom.xml first for better Docker layer caching @@ -13,7 +13,7 @@ COPY . . # Build the application RUN mvn -B --no-transfer-progress -f promcode-lyo-server/pom.xml -DskipTests clean package -am -FROM docker.io/library/jetty:12-jre21-eclipse-temurin +FROM docker.io/library/jetty:12.1-jdk25-eclipse-temurin # Add metadata LABEL org.opencontainers.image.title="PROMCODE Server" @@ -24,8 +24,8 @@ LABEL org.opencontainers.image.licenses="EPL-2.0" # WARNING DO NOT CHANGE WORKDIR or set it back to what it was before # $JETTY_BASE must be correct before starting Jetty -COPY --from=build /src/promcode-lyo-server/target/*.war /var/lib/jetty/webapps/ROOT.war +COPY --from=build /src/promcode-lyo-server/target/*.war /var/lib/jetty/webapps/promcode-server.war -RUN java -jar "$JETTY_HOME/start.jar" --add-modules=ee9-deploy,ee9-jsp,ee9-jstl +RUN java -jar "$JETTY_HOME/start.jar" --add-modules=ee10-deploy,ee10-jsp,ee10-jstl EXPOSE 8080 diff --git a/README.md b/README.md index 8638621..ae82c9b 100644 --- a/README.md +++ b/README.md @@ -7,31 +7,39 @@ This is a sample OSLC PROMCODE server, that is based on the [OASIS OSLC PROMCODE ## Running the OSLC PROMCODE server -Follow the 3 sections below to: +Follow the sections below to: 1. [Setup persistent store](#setup-persistent-store) 1. [Run the OSLC Server](#run-the-oslc-server) 1. [Navigate the OSLC server](#navigate-to-oslc-server) 1. [Populate the OSLC server](#populate-the-oslc-server) -### Setup persistent store +### Setup persistent store -You will set up an RDF data store to store the OSLC PROMCODE resources. +You will set up an RDF data store to store the OSLC PROMCODE resources. We will utilize the Apache Jena Fuseki that is an open source RDF server. You can select either Docker Compose, Docker version, or Java version. #### Docker Compose (Recommended) The easiest way to run both the PROMCODE server and Fuseki together: -1. Make sure you have Docker and Docker Compose installed +1. Make sure you have Docker Compose or Podman Compose installed 2. Run the following command from the repository root: ```bash - docker-compose up --build + docker compose up --build ``` + With Podman, use `podman compose up --build`. The legacy `docker-compose` commands also work when that executable is installed. 3. This will start both services: - Fuseki server at http://localhost:3030 (admin/admin) - PROMCODE server at http://localhost:8080/promcode-server +Compose uses Fuseki dataset `/ds` and persists it in the `fuseki-data` volume. +The standalone Fuseki examples below use `/dataset`, matching the source build's `store.properties`. Set `LYO_STORE_SPARQL_QUERY_ENDPOINT` and +`LYO_STORE_SPARQL_UPDATE_ENDPOINT` when using a different dataset. + +Set `FUSEKI_PORT` to change Fuseki's host port (default: 3030). The services still +communicate using their internal container ports. + To stop the services: ```bash docker-compose down @@ -48,14 +56,19 @@ Pre-built Docker images are available from GitHub Container Registry for both x8 ```bash # Run the latest version -docker run -p 8080:8080 ghcr.io/oslc/promcode-lyo-server:latest +docker run -p 8080:8080 --add-host=host.docker.internal:host-gateway \ + -e LYO_STORE_SPARQL_QUERY_ENDPOINT=http://host.docker.internal:3030/dataset/sparql \ + -e LYO_STORE_SPARQL_UPDATE_ENDPOINT=http://host.docker.internal:3030/dataset/update \ + ghcr.io/oslc/promcode-lyo-server:latest -# Run a specific version -docker run -p 8080:8080 ghcr.io/oslc/promcode-lyo-server:0.1.0 +# To select a published version, replace :latest with its version tag. ``` > **Note:** Images are automatically rebuilt weekly to ensure the latest security updates from base images. +This command connects to a Fuseki `/dataset` on the host. Use `/ds` instead when +connecting to the Compose Fuseki service through its published host port. + #### Docker version 1. Download docker version of fuseki server from https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-docker/4.2.0/ @@ -64,7 +77,7 @@ docker run -p 8080:8080 ghcr.io/oslc/promcode-lyo-server:0.1.0 #### Java version -1. Download jar file from https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-server/ +1. Download jar file from https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-server/ 2. For the latest Java version, run the following command - `java -cp jena-fuseki-server-4.2.0.jar org.apache.jena.fuseki.main.cmds.FusekiMainCmd --update --mem /dataset` 3. For Java 1.8 , run the following command @@ -75,8 +88,8 @@ docker run -p 8080:8080 ghcr.io/oslc/promcode-lyo-server:0.1.0 There are multiple options to run the OSLC Server. Below are the simplest options if you don't want to use anything except JDK and a Maven installation. Prerequisites: -- JDK 11 -- Maven 3 +- JDK 25 +- Maven 3.9 or newer #### Using built-in servers directly @@ -95,7 +108,7 @@ Follow these steps to start the server: ```sh cd promcode-lyo-server -mvn clean cargo:run +mvn clean package cargo:run -Pwith-jstl-impl ``` #### Using Docker Compose @@ -123,10 +136,10 @@ From that point, you can navigate through the Service Provider Catalog, or using ### Populate the OSLC server -THe server contains no data at startup. +The server contains no data at startup. You can add resources to the server by performing resource operations on their creation factories. -This can be done through the built-in Swagger editor, or using the command line. +This can be done through the built-in Swagger editor, or using the command line. **Bash/Linux/macOS:** ```bash @@ -138,12 +151,12 @@ curl -i --data-raw '@prefix dcterms: . dcterms:description "UI for making a reservation" .' \ -H "Accept: text/turtle;" \ -H "Content-type: text/turtle" \ -http://localhost:8080/oslc/service1/artifacts/create +http://localhost:8080/promcode-server/oslc/service1/artifacts/create ``` **PowerShell/Windows:** ```powershell -curl -i --data-raw '@prefix dcterms: . +curl.exe -i --data-raw '@prefix dcterms: . @prefix oslc_promcode: . <> a oslc_promcode:Artifact ; dcterms:identifier "1" ; @@ -151,18 +164,18 @@ curl -i --data-raw '@prefix dcterms: . dcterms:description "UI for making a reservation" .' ` -H "Accept: text/turtle;" ` -H "Content-type: text/turtle" ` -http://localhost:8080/oslc/service1/artifacts/create +http://localhost:8080/promcode-server/oslc/service1/artifacts/create ``` 2. To retrieve the created artifact: ```bash - curl -H "Accept: text/turtle;" http://localhost:8080/oslc/artifact/1 + curl -H "Accept: text/turtle;" http://localhost:8080/promcode-server/oslc/artifact/1 ``` ## Modifying the OSLC PROMCODE server with Lyo Designer -This server is modelled and generated using [Lyo Designer](https://oslc.github.io/developing-oslc-applications/eclipse_lyo/lyo-designer.html). +This server is modelled and generated using [Lyo Designer](https://oslc.github.io/developing-oslc-applications/eclipse_lyo/lyo-designer.html). It is recommended that any changes to the code should be done using LyoDesigner to maintain traceability between the model and the code. Below are some instructions on how to open the projects in this repository with LyoDesigner. @@ -178,7 +191,7 @@ The first step is to [install Lyo Designer](https://oslc.github.io/developing-os The PROMCODE domain model is already modelled and made available to be used by any PROMCODE server installation. -1. Import the [Lyo Git repository](https://github.com/eclipse/lyo.git) +1. Import the [Lyo Git repository](https://github.com/eclipse-lyo/lyo.git) 1. In LyoDesigner, import the Modelling project under the "domains\org.eclipse.lyo.tools.domainmodels" folder. This project contains the PROMCODE model, and all other OSLC Domain Specifications. diff --git a/docker-compose.yml b/docker-compose.yml index 173a778..465b631 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,23 +1,19 @@ -version: '3.8' - services: fuseki: - image: secoresearch/fuseki:latest - container_name: promcode-fuseki + image: docker.io/secoresearch/fuseki:latest ports: - - "127.0.0.1:3030:3030" + - "127.0.0.1:${FUSEKI_PORT:-3030}:3030" environment: - ADMIN_PASSWORD=admin - - FUSEKI_DATASET_1=dataset - ENABLE_UPDATE=true volumes: - - fuseki-data:/fuseki-data + - fuseki-data:/fuseki-base/databases networks: - promcode-network promcode-server: + image: ghcr.io/oslc/promcode-lyo-server:latest build: . - container_name: promcode-server ports: - "127.0.0.1:8080:8080" depends_on: diff --git a/promcode-lyo-server/pom.xml b/promcode-lyo-server/pom.xml index 290d60d..c0eae98 100644 --- a/promcode-lyo-server/pom.xml +++ b/promcode-lyo-server/pom.xml @@ -16,13 +16,13 @@ UTF-8 UTF-8 - 21 + 25 7.0.0-SNAPSHOT 5.32.8 8080 /promcode-server promcode-server - + @@ -46,12 +46,59 @@ true - + - + + spotbugs + + com.github.spotbugs + spotbugs-maven-plugin + 4.10.4.1 + + Max + High + true + true + + + spotbugs-check + verify + check + + + + + rewrite + + org.openrewrite.maven + rewrite-maven-plugin + 6.35.0 + src/main/java/** + org.openrewrite.java.migrate.UpgradeToJava21 + org.openrewrite.java.logging.slf4j.ParameterizedLogging + + + + org.openrewrite.recipe + rewrite-migrate-java + 3.34.1 + + + org.openrewrite.recipe + rewrite-testing-frameworks + 3.35.3 + + + org.openrewrite.recipe + rewrite-logging-frameworks + 3.29.1 + + + + @@ -74,7 +121,7 @@ - + @@ -82,6 +129,10 @@ --> + + org.junitjunit-bom + 6.0.3pomimport + org.eclipse.lyo lyo-bom @@ -95,7 +146,39 @@ - + + org.junit.jupiter + junit-jupiter + test + + + com.diffplug.selfie + selfie-runner-junit5 + 3.1.1 + test + + + org.mock-server + mockserver-netty + 5.15.0 + test + + + com.sun.xml.bind + jaxb-impl + + + org.glassfish.jaxb + jaxb-runtime + + + + + ch.qos.logback + logback-classic + 1.5.32 + runtime + @@ -103,12 +186,7 @@ org.slf4j slf4j-api - - org.slf4j - slf4j-simple - runtime - - + jakarta.servlet @@ -118,7 +196,7 @@ jakarta.servlet.jsp.jstl jakarta.servlet.jsp.jstl-api - provided @@ -154,7 +232,7 @@ org.glassfish.jersey.inject jersey-hk2 - + org.glassfish.jaxb jaxb-runtime @@ -182,7 +260,7 @@ oslc-domains 7.0.0-SNAPSHOT - + io.swagger.core.v3 @@ -214,17 +292,68 @@ - - + + org.apache.maven.plugins + maven-surefire-plugin + 3.6.0 + org.apache.maven.plugins maven-enforcer-plugin + 3.6.3 + + + enforce-toolchain + enforce + + + [3.9,) + [25,26) + + + + org.slf4j:slf4j-simple + org.slf4j:slf4j-reload4j + log4j:log4j + org.apache.logging.log4j:log4j-core + + + + + + + com.diffplug.spotless + spotless-maven-plugin + 3.10.2 + + + + src/test/java/**/*.java + + + 1.30.0 + + true + false + + + + + + check-format + verify + check + + + + + org.apache.maven.plugins maven-compiler-plugin - 3.15.0 + 3.16.0 -Xlint:fallthrough,unchecked,removal,deprecation,dep-ann,varargs,overloads,serial,try,finally @@ -241,13 +370,13 @@ <_initParams> false - + ${servlet.port} 5 - + @@ -255,16 +384,14 @@ cargo-maven3-plugin 1.10.28 - - tomcat10x - jetty12x - - - - - + + org.apache.tomcat + tomcat + 10.1.60 + zip + @@ -322,10 +449,10 @@ /swagger-ui/dist - + - +