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
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
- "**/target"
reports:
junit:
- "**/target/*-reports/TEST-*.xml"