Skip to content

Commit

Permalink
Add print stack to NewClassLoaderRunner
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Jan 8, 2022
1 parent ef3b4f1 commit a6f0beb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
11 changes: 10 additions & 1 deletion surefire-booter/pom.xml
Expand Up @@ -85,6 +85,16 @@
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>show-test-classpath</id>
<phase>generate-sources</phase>
<goals>
<goal>build-classpath</goal>
</goals>
<configuration>
<includeScope>test</includeScope>
</configuration>
</execution>
<execution>
<id>build-test-classpath</id>
<phase>generate-sources</phase>
Expand Down Expand Up @@ -125,7 +135,6 @@
<configuration>
<argLine>${jvm.args.tests} ${jacoco.agent}</argLine>
<useFile>true</useFile>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<includes>
<include>**/JUnit4SuiteTest.java</include>
</includes>
Expand Down
Expand Up @@ -216,6 +216,7 @@ private static URL[] toClassPath()
}
catch ( IOException e )
{
e.printStackTrace();
return new URL[0];
}
}
Expand All @@ -225,7 +226,7 @@ private static Collection<URL> toPathList( String path ) throws MalformedURLExce
Collection<URL> classPath = new HashSet<>();
for ( String file : path.split( pathSeparator ) )
{
classPath.add( new File( file ).toURL() );
classPath.add( new File( file ).toURI().toURL() );
}
return classPath;
}
Expand All @@ -241,13 +242,15 @@ private static Collection<URL> toPathList()
{
File f = new File( file );
File dir = f.getParentFile();
classPath.add( ( dir.getName().equals( "target" ) ? new File( dir, "classes" ) : f ).toURL() );
classPath.add(
( dir.getName().equals( "target" ) ? new File( dir, "classes" ) : f ).toURI().toURL() );
}
classPath.add( new File( "target/classes" ).toURL() );
classPath.add( new File( "target/test-classes" ).toURL() );
classPath.add( new File( "target/classes" ).toURI().toURL() );
classPath.add( new File( "target/test-classes" ).toURI().toURL() );
}
catch ( IOException e )
{
e.printStackTrace();
// turn to java.class.path
classPath.clear();
}
Expand Down

0 comments on commit a6f0beb

Please sign in to comment.