Skip to content

Commit

Permalink
[SUREFIRE-2005] Improved dump message "Boot Manifest-JAR contains abs…
Browse files Browse the repository at this point in the history
…olute paths in classpath" with exception message
  • Loading branch information
Tibor17 committed Feb 7, 2022
1 parent 463fb64 commit 550f98a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import static org.apache.maven.plugin.surefire.SurefireHelper.escapeToPlatformPath;
import static org.apache.maven.plugin.surefire.booterclient.JarManifestForkConfiguration.ClasspathElementUri.absolute;
import static org.apache.maven.plugin.surefire.booterclient.JarManifestForkConfiguration.ClasspathElementUri.relative;
import static org.apache.maven.surefire.shared.utils.StringUtils.isNotBlank;
import static org.apache.maven.surefire.api.util.internal.StringUtils.NL;

/**
Expand Down Expand Up @@ -198,6 +199,13 @@ static ClasspathElementUri toClasspathElementUri( @Nonnull Path parent,
+ "'"
+ NL
+ "Hint: <argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>";

if ( isNotBlank( e.getLocalizedMessage() ) )
{
error += NL;
error += e.getLocalizedMessage();
}

InPluginProcessDumpSingleton.getSingleton()
.dumpStreamText( error, dumpLogDirectory );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public URI answer( InvocationOnMock invocation ) throws URISyntaxException
}
} );
when( relativize( same( parent ), same( classPathElement ) ) )
.thenThrow( new IllegalArgumentException() );
.thenThrow( new IllegalArgumentException( "'other' has different root" ) );
when( toClasspathElementUri( same( parent ), same( classPathElement ), same( dumpDirectory ), anyBoolean() ) )
.thenCallRealMethod();
when( escapeUri( anyString(), any( Charset.class ) ) )
Expand Down

0 comments on commit 550f98a

Please sign in to comment.