@@ -187,6 +187,10 @@ subprojects { subproject ->
187
187
destinationFile = file(" $buildDir /jacoco.exec" )
188
188
}
189
189
useJUnitPlatform()
190
+
191
+ if (System . properties[' sonar.host.url' ]) {
192
+ finalizedBy jacocoTestReport
193
+ }
190
194
}
191
195
192
196
checkstyle {
@@ -196,14 +200,13 @@ subprojects { subproject ->
196
200
197
201
jacocoTestReport {
198
202
reports {
199
- xml. enabled false
203
+ xml. enabled true
200
204
csv. enabled false
201
- html. destination file(" ${ buildDir} /reports/jacoco/html" )
205
+ html. enabled false
206
+ xml. destination file(" ${ buildDir} /reports/jacoco/test/jacocoTestReport.xml" )
202
207
}
203
208
}
204
209
205
- build. dependsOn jacocoTestReport
206
-
207
210
publishing {
208
211
publications {
209
212
mavenJava(MavenPublication ) {
@@ -339,6 +342,16 @@ project ('spring-kafka-test') {
339
342
}
340
343
}
341
344
345
+ sonarqube {
346
+ properties {
347
+ property ' sonar.links.homepage' , linkHomepage
348
+ property ' sonar.links.ci' , linkCi
349
+ property ' sonar.links.issue' , linkIssue
350
+ property ' sonar.links.scm' , linkScmUrl
351
+ property ' sonar.links.scm_dev' , linkScmDevConnection
352
+ }
353
+ }
354
+
342
355
configurations {
343
356
docs
344
357
}
@@ -417,18 +430,6 @@ task reference(dependsOn: asciidoctor) {
417
430
418
431
reference. onlyIf { " $System . env . NO_REFERENCE_TASK " != ' true' || project. hasProperty(' ignoreEnvToStopReference' ) }
419
432
420
- sonarqube {
421
- properties {
422
- property ' sonar.jacoco.reportPath' , " ${ buildDir.name} /jacoco.exec"
423
- property ' sonar.links.homepage' , linkHomepage
424
- property ' sonar.links.ci' , linkCi
425
- property ' sonar.links.issue' , linkIssue
426
- property ' sonar.links.scm' , linkScmUrl
427
- property ' sonar.links.scm_dev' , linkScmDevConnection
428
- property ' sonar.java.coveragePlugin' , ' jacoco'
429
- }
430
- }
431
-
432
433
task api (type : Javadoc ) {
433
434
group = ' Documentation'
434
435
description = ' Generates aggregated Javadoc API documentation.'
0 commit comments