return buildPlexusContainer(mavenRequest,conf);
}
public static PlexusContainer buildPlexusContainer(ClassLoader mavenClassLoader, ClassLoader parent, MavenRequest mavenRequest) throws MavenEmbedderException {
DefaultContainerConfiguration conf = new DefaultContainerConfiguration();
conf.setAutoWiring( mavenRequest.isContainerAutoWiring() );
conf.setClassPathScanning( mavenRequest.getContainerClassPathScanning() );
conf.setComponentVisibility( mavenRequest.getContainerComponentVisibility() );
conf.setContainerConfigurationURL( mavenRequest.getOverridingComponentsXml() );
ClassWorld classWorld = new ClassWorld();
ClassRealm classRealm = new ClassRealm( classWorld, "maven", mavenClassLoader );
classRealm.setParentRealm( new ClassRealm( classWorld, "maven-parent",
parent == null ? Thread.currentThread().getContextClassLoader()
: parent ) );
conf.setRealm( classRealm );
conf.setClassWorld( classWorld );
return buildPlexusContainer(mavenRequest,conf);
}