From 9d8b38d309e131c5e4f79d5f0005cfe0cc2a6ee0 Mon Sep 17 00:00:00 2001 From: anthorob Date: Sun, 14 Jul 2024 13:05:00 -0400 Subject: [PATCH] ci: improve ci config for maven --- .gitlab-ci.yml | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 942e883..2afe48d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,24 @@ image: eclipse-temurin:17-jdk-alpine variables: - MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode" - MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" + MAVEN_OPTS: >- + -Dhttps.protocols=TLSv1.2 + -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository + -Dorg.slf4j.simpleLogger.showDateTime=true + -Djava.awt.headless=true + + MAVEN_CLI_OPTS: >- + --batch-mode + --errors + --fail-at-end + --show-version + --no-transfer-progress + -DinstallAtEnd=true + -DdeployAtEnd=true cache: paths: - - .m2/repository/ - - target/ + - .m2/repository stages: - compile @@ -18,19 +29,23 @@ compile: stage: compile script: - "chmod +x ./mvnw" - - "./mvnw --batch-mode compile" + - "./mvnw $MAVEN_CLI_OPTS compile" test: stage: test script: - "chmod +x ./mvnw" - - "./mvnw --batch-mode test" + - "./mvnw $MAVEN_CLI_OPTS test" package: stage: package script: - "chmod +x ./mvnw" - - "./mvnw --batch-mode package" + - "./mvnw $MAVEN_CLI_OPTS package -DskipTests=true" artifacts: + name: "Maven artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG" paths: - - target/netneutrality-jar-with-dependencies.jar \ No newline at end of file + - "**/target" + reports: + junit: + - "**/target/*-reports/TEST-*.xml" \ No newline at end of file