From 1b0b59d9fb52f6bdde94c30d84f0cae6c14a359f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20Diga=C5=88a?= Date: Thu, 27 Jan 2022 12:20:45 +0100 Subject: [PATCH] [SUREFIRE-1990] The previous XML report should be deleted before new run or re-run --- .../maven/plugin/surefire/report/StatelessXmlReporter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java index 54310696fd..984bd94178 100644 --- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java +++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java @@ -346,9 +346,8 @@ private OutputStream getOutputStream( WrappedReportEntry testSetReportEntry ) throws IOException { File reportFile = getReportFile( testSetReportEntry ); - File reportDir = reportFile.getParentFile(); - + reportFile.delete(); //noinspection ResultOfMethodCallIgnored reportDir.mkdirs(); return new BufferedOutputStream( new FileOutputStream( reportFile ), 64 * 1024 );