void (@Nullable MavenWorkspaceMap workspaceMap) { try { // replace some plexus components if (VersionComparatorUtil.compare("3.7.0-SNAPSHOT", getMavenVersion()) < 0) { myContainer.addComponent(getComponent(ArtifactFactory.class, "ide"), ArtifactFactory.ROLE); } myContainer.addComponent(getComponent(ArtifactResolver.class, "ide"), ArtifactResolver.ROLE); myContainer.addComponent(getComponent(RepositoryMetadataManager.class, "ide"), RepositoryMetadataManager.class.getName()); myContainer.addComponent(getComponent(PluginDescriptorCache.class, "ide"), PluginDescriptorCache.class.getName()); ModelInterpolator modelInterpolator = createAndPutInterpolator(myContainer); ModelValidator modelValidator; if (VersionComparatorUtil.compare(getMavenVersion(), "3.8.5") >= 0) { modelValidator = new CustomModelValidator385((CustomMaven3ModelInterpolator2)modelInterpolator, (DefaultModelValidator)getComponent(ModelValidator.class)); } else { modelValidator = getComponent(ModelValidator.class, "ide"); myContainer.addComponent(modelValidator, ModelValidator.class.getName()); } DefaultModelBuilder defaultModelBuilder = (DefaultModelBuilder)getComponent(ModelBuilder.class); defaultModelBuilder.setModelValidator(modelValidator); defaultModelBuilder.setModelInterpolator(modelInterpolator); ArtifactFactory artifactFactory = getComponent(ArtifactFactory.class); if (artifactFactory instanceof CustomMaven3ArtifactFactory) { ((CustomMaven3ArtifactFactory)artifactFactory).customize(); } ((CustomMaven3ArtifactResolver)getComponent(ArtifactResolver.class)).customize(workspaceMap); ((CustomMaven3RepositoryMetadataManager)getComponent(RepositoryMetadataManager.class)).customize(workspaceMap); } catch (Exception e) { throw wrapToSerializableRuntimeException(e); } }