void (MavenSession mavenSession, RepositorySystemSession session, List<ProjectBuildingResult> buildingResults) { if (session instanceof DefaultRepositorySystemSession) { int initialCapacity = (int)(buildingResults.size() * 1.5); Map<MavenId, Model> cacheMavenModelMap = new HashMap<>(initialCapacity); Map<String, MavenProject> mavenProjectMap = new HashMap<>(initialCapacity); for (ProjectBuildingResult result : buildingResults) { if (result.getProblems() != null && !result.getProblems().isEmpty()) continue; Model model = result.getProject().getModel(); String key = ArtifactUtils.key(model.getGroupId(), model.getArtifactId(), model.getVersion()); mavenProjectMap.put(key, result.getProject()); cacheMavenModelMap.put(new MavenId(model.getGroupId(), model.getArtifactId(), model.getVersion()), model); } mavenSession.setProjectMap(mavenProjectMap); ((DefaultRepositorySystemSession)session).setWorkspaceReader( new Maven40WorkspaceReader(session.getWorkspaceReader(), cacheMavenModelMap)); } }