-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathjava-mvn.yml
More file actions
47 lines (44 loc) · 1.65 KB
/
java-mvn.yml
File metadata and controls
47 lines (44 loc) · 1.65 KB
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
.java:init:
image:
name: ${BUILD_IMAGE_NAME}
before_script:
- |
if [ ! -z $CA_BUNDLE ]; then
DEFAULT_TRUSTSTORE="$JAVA_HOME/lib/security/cacerts"
DEFAULT_TRUSTSTORE_PASS="changeit"
keytool -import -alias mavensrv -file "$CA_BUNDLE" -keystore "$DEFAULT_TRUSTSTORE" -storepass "$DEFAULT_TRUSTSTORE_PASS" -noprompt
fi
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- .m2/repository/
.java:build:
extends: .java:init
script:
- cd $WORKING_DIR
- echo ${PROJECT_PATH}
- mvn $MAVEN_CLI_OPTS clean package -gs $MVN_CONFIG_FILE
artifacts:
paths:
- ${ARTEFACT_DIR}
expire_in: 1 seconds
interruptible: true
.java:sonar:
extends: .java:init
variables:
GIT_DEPTH: "0"
script:
- cd $WORKING_DIR
- mvn $MAVEN_CLI_OPTS clean org.jacoco:jacoco-maven-plugin:prepare-agent package test org.jacoco:jacoco-maven-plugin:report org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar -Dsonar.qualitygate.wait=true -Dsonar.projectName=$PROJECT_NAME -Dsonar.projectKey=$PROJECT_KEY -Dsonar.token=$SONAR_TOKEN -Dhttps.proxyHost=$PROXY_HOST -Dhttps.proxyPort=$PROXY_PORT -gs $MVN_CONFIG_FILE
.java:deploy:
extends: .java:init
script:
- cd $WORKING_DIR
- echo ${PROJECT_PATH}
- >
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/
artifacts:
paths:
- ${ARTEFACT_DIR}
expire_in: 1 seconds
interruptible: true