use of org.apache.maven.reporting.exec.MavenReportExecution in project maven-plugins by apache.
the class SiteMojo method execute.
/**
* {@inheritDoc} Generate the project site
* <p/>
* throws MojoExecutionException if any
*
* @see org.apache.maven.plugin.Mojo#execute()
*/
public void execute() throws MojoExecutionException, MojoFailureException {
if (skip) {
getLog().info("maven.site.skip = true: Skipping site generation");
return;
}
if (getLog().isDebugEnabled()) {
getLog().debug("executing Site Mojo");
}
checkInputEncoding();
List<MavenReportExecution> reports;
if (generateReports) {
reports = getReports();
} else {
reports = Collections.emptyList();
}
try {
List<Locale> localesList = getLocales();
// Default is first in the list
Locale defaultLocale = localesList.get(0);
Locale.setDefault(defaultLocale);
for (Locale locale : localesList) {
renderLocale(locale, reports);
}
} catch (RendererException e) {
throw new MojoExecutionException(e.getMessage(), e);
} catch (IOException e) {
throw new MojoExecutionException("Error during site generation", e);
}
}
Aggregations