From 542c697f8c5e86fdf3f30ec601613b268635f247 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 10 Jun 2026 11:53:29 +0200 Subject: [PATCH] ci: integrate frontend tests into Maven build + Docker - Add exec-maven-plugin to pom.xml with 3 npm executions: * npm-install (initialize phase) * frontend-build (generate-resources phase) * frontend-test (test phase) - Add skipFrontend and skipFrontendTests Maven properties - Dockerfile now runs npm test in frontend stage - Dockerfile removes -DskipTests and passes -DskipFrontend=true to the Maven stage (frontend already built in its own stage) --- Dockerfile | 3 ++- pom.xml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fb79e3e..372c97c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ COPY frontend/package.json frontend/package-lock.json ./ RUN npm ci 2>/dev/null || npm install --legacy-peer-deps COPY frontend/ ./ RUN npm run build +RUN npm test # ─── 2. Build Quarkus app ──────────────────────── FROM maven:3-eclipse-temurin-21-alpine AS build @@ -15,7 +16,7 @@ COPY pom.xml ./ COPY src ./src # Copy the built frontend into the source tree so maven-resources-plugin picks it up COPY --from=frontend /build/dist ./frontend/dist/ -RUN mvn package -DskipTests -q +RUN mvn package -q -DskipFrontend=true # ─── 3. Runtime ────────────────────────────────── FROM eclipse-temurin:21-jre-alpine diff --git a/pom.xml b/pom.xml index 1aa4bc7..8b0b48d 100644 --- a/pom.xml +++ b/pom.xml @@ -15,6 +15,10 @@ UTF-8 3.19.2 io.quarkus.platform + + false + + false @@ -97,6 +101,55 @@ + + + org.codehaus.mojo + exec-maven-plugin + 3.5.0 + + + npm-install + initialize + exec + + frontend + npm + + ci + --prefer-offline + + ${skipFrontend} + + + + frontend-build + generate-resources + exec + + frontend + npm + + run + build + + ${skipFrontend} + + + + frontend-test + test + exec + + frontend + npm + + test + + ${skipFrontendTests} + + + +