MavenServerExecutionResult (Maven40ExecutionResult result) { File file = result.getPomFile(); Collection<MavenProjectProblem> problems = MavenProjectProblem.createProblemsList(); myEmbedder.collectProblems(file, result.getExceptions(), result.getModelProblems(), problems); Collection<MavenProjectProblem> unresolvedProblems = new HashSet<>(); collectUnresolvedArtifactProblems(file, result.getDependencyResolutionResult(), unresolvedProblems); MavenProject mavenProject = result.getMavenProject(); if (mavenProject == null) return new MavenServerExecutionResult(null, problems, Collections.emptySet()); MavenModel model = new MavenModel(); try { DependencyResolutionResult dependencyResolutionResult = result.getDependencyResolutionResult(); DependencyNode dependencyGraph = dependencyResolutionResult != null ? dependencyResolutionResult.getDependencyGraph() : null; List<DependencyNode> dependencyNodes = dependencyGraph != null ? dependencyGraph.getChildren() : Collections.emptyList(); model = Maven40AetherModelConverter.convertModelWithAetherDependencyTree( mavenProject.getModel(), mavenProject.getCompileSourceRoots(), mavenProject.getTestCompileSourceRoots(), mavenProject.getArtifacts(), dependencyNodes, Collections.emptyList(), //mavenProject.getExtensionArtifacts(), myLocalRepositoryFile); } catch (Exception e) { myEmbedder.collectProblems(mavenProject.getFile(), Collections.singleton(e), result.getModelProblems(), problems); } RemoteNativeMaven40ProjectHolder holder = new RemoteNativeMaven40ProjectHolder(mavenProject); try { UnicastRemoteObject.exportObject(holder, 0); } catch (RemoteException e) { throw new RuntimeException(e); } Collection<String> activatedProfiles = Maven40ProfileUtil.collectActivatedProfiles(mavenProject); Map<String, String> mavenModelMap = Maven40ModelConverter.convertToMap(mavenProject.getModel()); MavenServerExecutionResult.ProjectData data = new MavenServerExecutionResult.ProjectData(model, mavenModelMap, holder, activatedProfiles); if (null == model.getBuild() || null == model.getBuild().getDirectory()) { data = null; } return new MavenServerExecutionResult(data, problems, Collections.emptySet(), unresolvedProblems); }