diff --git a/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java b/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java index 20fba421fd..c534218635 100644 --- a/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java +++ b/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java @@ -20,6 +20,9 @@ */ import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.file.Files; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -686,6 +689,24 @@ public void setReportsDirectory( File reportsDirectory ) @Override public String getTest() { + File f = new File( test ); + if ( f.exists() && !f.isDirectory ( ) ) + { + try + { + List l = Files.readAllLines( f.toPath(), Charset.defaultCharset( ) ); + StringBuilder sb = new StringBuilder( ); + for ( String s : l ) + { + sb.append( s + "," ); + } + String s = sb.toString( ); + return s.substring( 0 , s.length( ) - 1 ); + } + catch ( IOException e ) + { + } + } return test; }