*
*/
private void createXref( Locale locale, String destinationDirectory, List sourceDirs )
throws IOException, JxrException
{
JXR jxr = new JXR();
jxr.setDest( destinationDirectory );
if ( StringUtils.isEmpty( inputEncoding ) )
{
String platformEncoding = System.getProperty( "file.encoding" );
getLog().warn( "File encoding has not been set, using platform encoding " + platformEncoding
+ ", i.e. build is platform dependent!" );
}
jxr.setInputEncoding( inputEncoding );
jxr.setLocale( locale );
jxr.setLog( new PluginLogAdapter( getLog() ) );
jxr.setOutputEncoding( getOutputEncoding() );
jxr.setRevision( "HEAD" );
jxr.setJavadocLinkDir( getJavadocLocation() );
// Set include/exclude patterns on the jxr instance
if ( excludes != null && !excludes.isEmpty() )
{
jxr.setExcludes( (String[]) excludes.toArray( new String[0] ) );
}
if ( includes != null && !includes.isEmpty() )
{
jxr.setIncludes( (String[]) includes.toArray( new String[0] ) );
}
// avoid winding up using Velocity in two class loaders.
ClassLoader savedTccl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader( getClass().getClassLoader() );
jxr.xref( sourceDirs, templateDir, windowTitle, docTitle, getBottomText( project.getInceptionYear(), project
.getOrganization() ) );
} finally {
Thread.currentThread().setContextClassLoader( savedTccl );
}