forked from itaifrenkel/java-hello-world-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
42 lines (36 loc) · 994 Bytes
/
Jenkinsfile
File metadata and controls
42 lines (36 loc) · 994 Bytes
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
pipeline {
agent any
tools {
jdk 'jdk17'
maven 'maven3'
}
parameters {
string(name: 'PROJECT_KEY',
defaultValue: 'java-hello-world-webapp',
description: 'SonarQube Project Key')
}
stages {
stage('Checkout Code') {
steps {
git branch: 'master',
url: 'https://github.com/Namitha2000/java-hello-world-webapp.git'
}
}
stage('Build') {
steps {
sh 'mvn clean package -DskipTests'
}
}
stage('SonarQube Analysis') {
steps {
withSonarQubeEnv('SonarQube') {
sh """
mvn clean verify \
org.sonarsource.scanner.maven:sonar-maven-plugin:3.10.0.2594:sonar \
-Dsonar.projectKey=${params.PROJECT_KEY}
"""
}
}
}
}
}