-
Notifications
You must be signed in to change notification settings - Fork 3
/
java-mvn.yml
71 lines (67 loc) · 2.5 KB
/
java-mvn.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.java:init:
image:
name: ${BUILD_IMAGE_NAME}
variables:
MAVEN_CLI_ADDITIONAL_OPTS: " $MAVEN_CLI_OPTS -Djavax.net.ssl.trustStore=maven.jks -Djavax.net.ssl.trustStorePassword=changeit "
before_script:
- |
if [ ! -z $CA_BUNDLE ]; then
keytool -v -alias mavensrv -import -file $CA_BUNDLE -keystore maven.jks -storepass changeit -noprompt
fi
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- .m2/repository/
.java:build:
extends: .java:init
script:
- cd $WORKING_DIR
- echo ${PROJECT_PATH}
- >
if [ ! -z $CA_BUNDLE ]; then
mvn $MAVEN_CLI_ADDITIONAL_OPTS clean package -s $MVN_CONFIG_FILE
else
mvn $MAVEN_CLI_OPTS clean package -s $MVN_CONFIG_FILE
fi
artifacts:
paths:
- ${ARTEFACT_DIR}
expire_in: 1 seconds
interruptible: true
.java:sonar-jacoco:
extends: .java:init
variables:
GIT_DEPTH: "0"
script:
- cd $WORKING_DIR
- mvn $MAVEN_CLI_ADDITIONAL_OPTS clean org.jacoco:jacoco-maven-plugin:prepare-agent package test jacoco:report sonar:sonar -Dsonar.qualitygate.wait=true -Dsonar.login=$SONAR_TOKEN -s $MVN_CONFIG_FILE
allow_failure: true
.java:sonar:
extends: .java:init
variables:
GIT_DEPTH: "0"
script:
- cd $WORKING_DIR
- >
if [ ! -z $CA_BUNDLE ]; then
mvn $MAVEN_CLI_ADDITIONAL_OPTS clean package test sonar:sonar -Dsonar.qualitygate.wait=true -Dsonar.projectKey=${PROJECT_KEY} -Dsonar.login=$SONAR_TOKEN -s $MVN_CONFIG_FILE
else
mvn $MAVEN_CLI_OPTS clean package test sonar:sonar -Dsonar.qualitygate.wait=true -Dsonar.projectKey=${PROJECT_KEY} -Dsonar.login=$SONAR_TOKEN -s $MVN_CONFIG_FILE
fi
allow_failure: true
.java:deploy:
extends: .java:init
script:
- cd $WORKING_DIR
- echo ${PROJECT_PATH}
- >
if [ ! -z $CA_BUNDLE ]; then
mvn $MAVEN_CLI_ADDITIONAL_OPTS clean deploy -s $MVN_CONFIG_FILE -DaltReleaseDeploymentRepository=nexus::default::${NEXUS_HOST_URL}/repository/${PROJECT_PATH}-repository-release/ -DaltSnapshotDeploymentRepository=nexus::default::${NEXUS_HOST_URL}/repository/${PROJECT_PATH}-repository-snapshot/
else
mvn $MAVEN_CLI_OPTS clean deploy -s $MVN_CONFIG_FILE -DaltReleaseDeploymentRepository=nexus::default::${NEXUS_HOST_URL}/repository/${PROJECT_PATH}-repository-release/ -DaltSnapshotDeploymentRepository=nexus::default::${NEXUS_HOST_URL}/repository/${PROJECT_PATH}-repository-snapshot/
fi
artifacts:
paths:
- ${ARTEFACT_DIR}
expire_in: 1 seconds
interruptible: true