try
{
final File documentationSourceDir = new File(this.documentationSourceDirectory);
if (!documentationSourceDir.exists())
{
throw new MojoExecutionException("Documentation source location is invalid");
}
/**
* Retrieve a directory listing with a filename filter
*/
FilenameFilter filter = new FilenameFilter()
{
final String[] filteredReports =
{
"cvs",
"integration.html",
"dependencies.html",
"dependency-convergence.html",
"issue-tracking.html",
"mailing-lists.html",
"license.html",
"project-summary.html",
"team-list.html",
"source-repository.html"
};
public boolean accept(File dir, String name)
{
boolean accept = true;
for (int i = 0; i < filteredReports.length; i++)
{
if (name.equalsIgnoreCase(filteredReports[i]))
{
accept = false;
}
}
return accept;
}
};
final File[] files = documentationSourceDir.listFiles(filter);
for (int i = 0; i < files.length; i++)
{
this.copyFile(
files[i],
new File(
this.documentationOutputDirectory,
files[i].getName()));
}
}
catch (final Throwable throwable)
{
if (throwable instanceof MojoExecutionException)
{
throw (MojoExecutionException)throwable;
}
throw new MojoExecutionException("An error occured copying documentation/reporting artifacts '" +
this.project.getArtifactId() + "'",
ExceptionUtils.getRootCause(throwable));
}
}