Search in sources :

Example 1 with ClassRealm

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);
    }
}
Also used : ClassRealm(org.codehaus.classworlds.ClassRealm) Method(java.lang.reflect.Method) AuthenticationException(org.apache.maven.wagon.authentication.AuthenticationException) CommandExecutionException(org.apache.maven.wagon.CommandExecutionException) ComponentConfigurationException(org.codehaus.plexus.component.configurator.ComponentConfigurationException) ComponentLifecycleException(org.codehaus.plexus.component.repository.exception.ComponentLifecycleException) TransferFailedException(org.apache.maven.wagon.TransferFailedException) ConnectionException(org.apache.maven.wagon.ConnectionException) AuthorizationException(org.apache.maven.wagon.authorization.AuthorizationException) ComponentLookupException(org.codehaus.plexus.component.repository.exception.ComponentLookupException) ContextException(org.codehaus.plexus.context.ContextException) UnsupportedProtocolException(org.apache.maven.wagon.UnsupportedProtocolException) MalformedURLException(java.net.MalformedURLException) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) ResourceDoesNotExistException(org.apache.maven.wagon.ResourceDoesNotExistException) ComponentConfigurationException(org.codehaus.plexus.component.configurator.ComponentConfigurationException)

Aggregations

Method (java.lang.reflect.Method)1 MalformedURLException (java.net.MalformedURLException)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 CommandExecutionException (org.apache.maven.wagon.CommandExecutionException)1 ConnectionException (org.apache.maven.wagon.ConnectionException)1 ResourceDoesNotExistException (org.apache.maven.wagon.ResourceDoesNotExistException)1 TransferFailedException (org.apache.maven.wagon.TransferFailedException)1 UnsupportedProtocolException (org.apache.maven.wagon.UnsupportedProtocolException)1 AuthenticationException (org.apache.maven.wagon.authentication.AuthenticationException)1 AuthorizationException (org.apache.maven.wagon.authorization.AuthorizationException)1 ClassRealm (org.codehaus.classworlds.ClassRealm)1 ComponentConfigurationException (org.codehaus.plexus.component.configurator.ComponentConfigurationException)1 ComponentLifecycleException (org.codehaus.plexus.component.repository.exception.ComponentLifecycleException)1 ComponentLookupException (org.codehaus.plexus.component.repository.exception.ComponentLookupException)1 ContextException (org.codehaus.plexus.context.ContextException)1