ci: improve ci config for maven

This commit is contained in:
anthorob committed 2024-07-14 13:05:00 -04:00
1 parent 719c55ee27
commit 9d8b38d309
1 file changed
+23 -8
+23 -8
View File
@@ -1,13 +1,24 @@
image: eclipse-temurin:17-jdk-alpine image: eclipse-temurin:17-jdk-alpine
variables: variables:
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode" MAVEN_OPTS: >-
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" -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: cache:
paths: paths:
- .m2/repository/ - .m2/repository
- target/
stages: stages:
- compile - compile
@@ -18,19 +29,23 @@ compile:
stage: compile stage: compile
script: script:
- "chmod +x ./mvnw" - "chmod +x ./mvnw"
- "./mvnw --batch-mode compile" - "./mvnw $MAVEN_CLI_OPTS compile"
test: test:
stage: test stage: test
script: script:
- "chmod +x ./mvnw" - "chmod +x ./mvnw"
- "./mvnw --batch-mode test" - "./mvnw $MAVEN_CLI_OPTS test"
package: package:
stage: package stage: package
script: script:
- "chmod +x ./mvnw" - "chmod +x ./mvnw"
- "./mvnw --batch-mode package" - "./mvnw $MAVEN_CLI_OPTS package -DskipTests=true"
artifacts: artifacts:
name: "Maven artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
paths: paths:
- target/netneutrality-jar-with-dependencies.jar - "**/target"
reports:
junit:
- "**/target/*-reports/TEST-*.xml"