public static @NonNull MavenEmbedder createProjectLikeEmbedder() throws PlexusContainerException {
final String mavenCoreRealmId = "plexus.core";
ContainerConfiguration dpcreq = new DefaultContainerConfiguration()
.setClassWorld( new ClassWorld(mavenCoreRealmId, EmbedderFactory.class.getClassLoader()) )
.setName("maven");
DefaultPlexusContainer pc = new DefaultPlexusContainer(dpcreq, new ExtensionModule());
pc.setLoggerManager(new NbLoggerManager());
Properties userprops = new Properties();
userprops.putAll(getCustomGlobalUserProperties());
EmbedderConfiguration configuration = new EmbedderConfiguration(pc, cloneStaticProps(), userprops, true, getSettingsXml());
try {
return new MavenEmbedder(configuration);
} catch (ComponentLookupException ex) {
throw new PlexusContainerException(ex.toString(), ex);
}
}