use of org.codehaus.classworlds.ClassRealm in project maven-plugins by apache.
the class AbstractDeployMojo method configureWagonWithMaven2.
private static void configureWagonWithMaven2(ComponentConfigurator componentConfigurator, Wagon wagon, PlexusConfiguration plexusConf, PlexusContainer container) throws ComponentConfigurationException {
// so use some reflection see MSITE-609
try {
Method methodContainerRealm = container.getClass().getMethod("getContainerRealm");
ClassRealm realm = (ClassRealm) methodContainerRealm.invoke(container);
Method methodConfigure = componentConfigurator.getClass().getMethod("configureComponent", new Class[] { Object.class, PlexusConfiguration.class, ClassRealm.class });
methodConfigure.invoke(componentConfigurator, wagon, plexusConf, realm);
} catch (Exception e) {
throw new ComponentConfigurationException("Failed to configure wagon component for a Maven2 use " + e.getMessage(), e);
}
}
Aggregations