}
catch ( SiteToolException e )
{
throw new MojoExecutionException( "SiteToolException: " + e.getMessage(), e );
}
SiteRenderingContext context;
if ( templateFile != null )
{
if ( !templateFile.exists() )
{
throw new MojoFailureException( "Template file '" + templateFile + "' does not exist" );
}
context = siteRenderer.createContextForTemplate( templateFile, skinFile, attributes, decorationModel,
project.getName(), locale );
}
else
{
context = siteRenderer.createContextForSkin( skinFile, attributes, decorationModel, project.getName(),
locale );
}
// Generate static site
if ( !locale.getLanguage().equals( Locale.getDefault().getLanguage() ) )
{
context.addSiteDirectory( new File( siteDirectory, locale.getLanguage() ) );
context.addModuleDirectory( new File( xdocDirectory, locale.getLanguage() ), "xdoc" );
context.addModuleDirectory( new File( xdocDirectory, locale.getLanguage() ), "fml" );
}
else
{
context.addSiteDirectory( siteDirectory );
context.addModuleDirectory( xdocDirectory, "xdoc" );
context.addModuleDirectory( xdocDirectory, "fml" );
}
if ( moduleExcludes != null )
{
context.setModuleExcludes( moduleExcludes );
}
return context;
}