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 f925a7c251..e789fb70d0 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 @@ -456,7 +456,8 @@ private void startTestElement(XMLWriter ppw, WrappedReportEntry report) throws I String className = phrasedClassName ? report.getReportSourceName(reportNameSuffix) - : report.getSourceText() != null ? report.getSourceText() : report.getSourceName(reportNameSuffix); + : report.getSourceName(reportNameSuffix); + if (className != null) { ppw.addAttribute("classname", extraEscapeAttribute(className)); }