@PostConstruct
public void initialize()
throws PlexusSisuBridgeException
{
DefaultContainerConfiguration conf = new DefaultContainerConfiguration();
conf.setAutoWiring( containerAutoWiring );
conf.setClassPathScanning( containerClassPathScanning );
conf.setComponentVisibility( containerComponentVisibility );
conf.setContainerConfigurationURL( overridingComponentsXml );
ClassWorld classWorld = new ClassWorld();
ClassLoader tccl = Thread.currentThread().getContextClassLoader();
containerRealm = new ClassRealm( classWorld, "maven", tccl );
// olamy hackhish but plexus-sisu need a URLClassLoader with URL filled
if ( tccl instanceof URLClassLoader )
{
URL[] urls = ( (URLClassLoader) tccl ).getURLs();
for ( URL url : urls )
{
containerRealm.addURL( url );
}
}
conf.setRealm( containerRealm );
//conf.setClassWorld( classWorld );
ClassLoader ori = Thread.currentThread().getContextClassLoader();