log.info( "Generating \"" + localReportName + "\" report"
+ ( pluginInfo == null ? "." : ( " --- " + pluginInfo ) ) );
MySinkFactory sf = new MySinkFactory( renderingContext );
SiteRendererSink sink = new SiteRendererSink( renderingContext );
ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
if ( classLoader != null )
{
Thread.currentThread().setContextClassLoader( classLoader );
}
try
{
if ( report instanceof MavenMultiPageReport )
{
// extended multi-page API
( (MavenMultiPageReport) report ).generate( sink, sf, locale );
}
else if ( generateMultiPage( locale, sf, sink ) )
{
// extended multi-page API for Maven 2.2, only accessible by reflection API
}
else
{
// old single-page-only API
report.generate( sink, locale );
}
}
catch ( MavenReportException e )
{
throw new RendererException( "Error rendering Maven report: " + e.getMessage(), e );
}
catch ( LinkageError e )
{
log.warn( "An issue has occurred with report " + report.getClass().getName() + ", skip LinkageError "
+ e.getMessage() + ", please report an issue to Maven dev team.", e );
}
finally
{
if ( classLoader != null )
{
Thread.currentThread().setContextClassLoader( originalClassLoader );
}
sink.close();
}
if ( !report.isExternalReport() )
{
try