Skip to content

Commit 4de5ec5

Browse files
committed
Azure DevOps pipeline: Restore sonarCloud analysis and update maven tasks
1 parent 6ffc85b commit 4de5ec5

File tree

1 file changed

+40
-17
lines changed

1 file changed

+40
-17
lines changed

azure-pipelines.yml

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,55 @@ jobs:
99
displayName: Analyse code with SonarQube
1010

1111
steps:
12+
- task: SonarCloudPrepare@3
13+
displayName: 'Prepare SonarCloud analysis'
14+
inputs:
15+
SonarCloud: 'SonarCloud'
16+
organization: 'aqualityautomation'
17+
scannerMode: 'CLI'
18+
configMode: 'file'
19+
extraProperties: 'sonar.coverage.exclusions=**/**'
1220

13-
- task: Maven@3
14-
displayName: 'Build project'
15-
inputs:
16-
mavenPomFile: 'pom.xml'
17-
mavenOptions: '-Xmx3072m'
18-
javaHomeOption: 'JDKVersion'
19-
jdkVersionOption: '11'
20-
jdkArchitectureOption: 'x64'
21-
publishJUnitResults: true
22-
testResultsFiles: '**/surefire-reports/TEST-*.xml'
23-
goals: 'clean'
21+
- task: Maven@4
22+
displayName: 'Build project'
23+
inputs:
24+
mavenPomFile: 'pom.xml'
25+
goals: 'clean'
26+
publishJUnitResults: true
27+
testResultsFiles: '**/surefire-reports/TEST-*.xml'
28+
javaHomeOption: 'JDKVersion'
29+
jdkVersionOption: '1.11'
30+
mavenVersionOption: 'Default'
31+
mavenAuthenticateFeed: false
32+
effectivePomSkip: false
33+
sonarQubeRunAnalysis: false
34+
35+
- task: SonarCloudAnalyze@3
36+
inputs:
37+
jdkversion: 'JAVA_HOME_21_X64'
38+
displayName: 'Run SonarCloud code analysis'
39+
continueOnError: true
40+
41+
- task: SonarCloudPublish@3
42+
displayName: 'Publish SonarCloud quality gate results'
43+
inputs:
44+
pollingTimeoutSec: '300'
2445

2546
- job: tests
2647
displayName: Run tests
2748

2849
steps:
2950

30-
- task: Maven@3
51+
- task: Maven@4
3152
displayName: 'Run tests'
3253
inputs:
3354
mavenPomFile: 'pom.xml'
34-
mavenOptions: '-Xmx3072m'
35-
javaHomeOption: 'JDKVersion'
36-
jdkVersionOption: '11'
37-
jdkArchitectureOption: 'x64'
55+
goals: 'clean test -Dprofile=local'
3856
publishJUnitResults: true
3957
testResultsFiles: '**/surefire-reports/TEST-*.xml'
40-
goals: 'test -Dprofile=local'
58+
javaHomeOption: 'JDKVersion'
59+
jdkVersionOption: '1.11'
60+
mavenVersionOption: 'Default'
61+
mavenAuthenticateFeed: false
62+
effectivePomSkip: false
63+
sonarQubeRunAnalysis: false

0 commit comments

Comments
 (0)