use of org.apache.maven.plugin.PluginConfigurationException in project maven-plugins by apache.
the class PdfMojo method getMavenReport.
/**
* @param mojoDescriptor not null
* @return the MavenReport instance for the given mojoDescriptor.
* @throws MojoExecutionException if any
* @since 1.1
*/
private MavenReport getMavenReport(MojoDescriptor mojoDescriptor) throws MojoExecutionException {
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(mojoDescriptor.getPluginDescriptor().getClassRealm().getClassLoader());
MojoExecution mojoExecution = new MojoExecution(mojoDescriptor);
return pluginManager.getReport(project, mojoExecution, session);
} catch (ArtifactNotFoundException e) {
throw new MojoExecutionException("ArtifactNotFoundException: " + e.getMessage(), e);
} catch (ArtifactResolutionException e) {
throw new MojoExecutionException("ArtifactResolutionException: " + e.getMessage(), e);
} catch (PluginConfigurationException e) {
throw new MojoExecutionException("PluginConfigurationException: " + e.getMessage(), e);
} catch (PluginManagerException e) {
throw new MojoExecutionException("PluginManagerException: " + e.getMessage(), e);
} finally {
Thread.currentThread().setContextClassLoader(oldClassLoader);
}
}
Aggregations