@@ -109,9 +109,9 @@ import-module "Microsoft.TeamFoundation.DistributedTask.Task.TestResults"
109109
110110
111111$buildRootPath = Split-Path $mavenPOMFile - Parent
112- $reportDirectoryName = [ guid ]::NewGuid()
112+ $reportDirectoryName = " ReportDirectory_C91CDE2D-CC66-4541-9C27-E3EF6CB3DB16 "
113113$reportDirectoryNameCobertura = " target\site\cobertura"
114- $reportPOMFileName = [ guid ]::NewGuid().tostring() + " .xml"
114+ $reportPOMFileName = " ReportPOMFile_4E52C1C4-8C32-4580-A54D-41D5E9ED1F74 .xml"
115115$reportPOMFile = Join-Path $buildRootPath $reportPOMFileName
116116$reportDirectory = Join-Path $buildRootPath $reportDirectoryName
117117$reportDirectoryCobertura = Join-Path $buildRootPath $reportDirectoryNameCobertura
@@ -126,6 +126,24 @@ $CCReportTask = "jacoco:report"
126126
127127Write-Verbose " SummaryFileCobertura = $summaryFileCobertura "
128128
129+ if (Test-Path $reportDirectory )
130+ {
131+ # delete any previous code coverage data
132+ rm - r $reportDirectory - force | Out-Null
133+ }
134+
135+ if (Test-Path $reportDirectoryCobertura )
136+ {
137+ # delete any previous code coverage data from Cobertura
138+ rm - r $reportDirectoryCobertura - force | Out-Null
139+ }
140+
141+ if (Test-Path $reportPOMFile )
142+ {
143+ # delete any previous code coverage data
144+ rm $reportPOMFile - force | Out-Null
145+ }
146+
129147if ($isCoverageEnabled )
130148{
131149 if (Test-Path $targetDirectory )
@@ -184,26 +202,4 @@ ElseIf ($codeCoverageTool -eq "Cobertura")
184202# Run SonarQube analysis by invoking Maven with the "sonar:sonar" goal
185203RunSonarQubeAnalysis $sqAnalysisEnabled $sqConnectedServiceName $sqDbDetailsRequired $sqDbUrl $sqDbUsername $sqDbPassword $options $mavenPOMFile $execFileJacoco
186204
187- if (Test-Path $reportDirectory )
188- {
189- # delete any previous code coverage data
190- rm - r $reportDirectory - force | Out-Null
191- }
192-
193- if (Test-Path $reportDirectoryCobertura )
194- {
195- # delete any previous code coverage data from Cobertura
196- rm - r $reportDirectoryCobertura - force | Out-Null
197- }
198-
199- if (Test-Path $reportPOMFile )
200- {
201- # delete any previous code coverage data
202- rm $reportPOMFile - force | Out-Null
203- }
204-
205205Write-Verbose " Leaving script Maven.ps1"
206-
207-
208-
209-
0 commit comments