use of org.apache.maven.plugins.checkstyle.rss.CheckstyleRssGeneratorRequest in project maven-plugins by apache.
the class AbstractCheckstyleReport method executeReport.
/** {@inheritDoc} */
public void executeReport(Locale locale) throws MavenReportException {
checkDeprecatedParameterUsage(sourceDirectory, "sourceDirectory", "sourceDirectories");
checkDeprecatedParameterUsage(testSourceDirectory, "testSourceDirectory", "testSourceDirectories");
locator.addSearchPath(FileResourceLoader.ID, project.getFile().getParentFile().getAbsolutePath());
locator.addSearchPath("url", "");
locator.setOutputDirectory(new File(project.getBuild().getDirectory()));
// for when we start using maven-shared-io and maven-shared-monitor...
// locator = new Locator( new MojoLogMonitorAdaptor( getLog() ) );
// locator = new Locator( getLog(), new File( project.getBuild().getDirectory() ) );
ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
try {
CheckstyleExecutorRequest request = createRequest().setLicenseArtifacts(collectArtifacts("license")).setConfigurationArtifacts(collectArtifacts("configuration")).setOmitIgnoredModules(omitIgnoredModules);
CheckstyleResults results = checkstyleExecutor.executeCheckstyle(request);
ResourceBundle bundle = getBundle(locale);
generateReportStatics();
generateMainReport(results, bundle);
if (enableRSS) {
CheckstyleRssGeneratorRequest checkstyleRssGeneratorRequest = new CheckstyleRssGeneratorRequest(this.project, this.getCopyright(), outputDirectory, getLog());
checkstyleRssGenerator.generateRSS(results, checkstyleRssGeneratorRequest);
}
} catch (CheckstyleException e) {
throw new MavenReportException("Failed during checkstyle configuration", e);
} catch (CheckstyleExecutorException e) {
throw new MavenReportException("Failed during checkstyle execution", e);
} finally {
//be sure to restore original context classloader
Thread.currentThread().setContextClassLoader(currentClassLoader);
}
}
Aggregations