EmbeddedMojo mojo = new EmbeddedMojo();
mojo.setClasspathElements(list);
ClassLoader newClassLoader = mojo.createClassLoader(oldClassLoader);
Thread.currentThread().setContextClassLoader(newClassLoader);
ReportingTypeConverterLoader loader = new ReportingTypeConverterLoader();
ReportingTypeConverterRegistry registry = new ReportingTypeConverterRegistry();
loader.load(registry);
getLog().error(
"FOUND type mapping; count = "
+ loader.getTypeConversions().length);
String[] errors = registry.getErrors();
for (String error : errors) {
getLog().error(error);
}
generateReport(getSink(), locale, loader.getTypeConversions());
} catch (Exception e) {
throw new MavenReportException(
"Failed to generate TypeConverters report", e);
} finally {
Thread.currentThread().setContextClassLoader(oldClassLoader);