forked from hellokaton/java11-examples
-
Notifications
You must be signed in to change notification settings - Fork 156
Expand file tree
/
Copy pathazure-pipelines-1.yml
More file actions
34 lines (30 loc) · 895 Bytes
/
azure-pipelines-1.yml
File metadata and controls
34 lines (30 loc) · 895 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
trigger:
- master
pool:
name: linuxvm
steps:
# Prepare SonarCloud
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'sonaraccess' # Service connection name in DevOps
organization: 'amitow23' # Your SonarCloud org
scannerMode: 'Other'
configMode: 'manual'
projectKey: 'amitow23_amitow' # Replace with your actual project key
projectName: 'MyJavaApp' # Optional
# Build & run Sonar scan with Maven
- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
goals: 'clean verify sonar:sonar'
options: >
-Dsonar.userHome=$(Pipeline.Workspace)/.sonar
# Publish results to SonarCloud
- task: SonarCloudPublish@1
inputs:
pollingTimeoutSec: '300'