[maven] IDEA-91662 doesn't take into account mirror repositories as Indexed Maven...
[idea/community.git] / plugins / maven / maven3-server-impl / src / org / jetbrains / idea / maven / server / Maven3XServerEmbedder.java
index 4ce9889d813e175c7dc2da6ef3742ab55b248308..b6307eb16401fa960880521f2065eb32b5318d05 100644 (file)
@@ -94,6 +94,8 @@ import java.rmi.RemoteException;
 import java.rmi.server.UnicastRemoteObject;
 import java.util.*;
 
+import static org.jetbrains.idea.maven.server.MavenModelConverter.convertRemoteRepositories;
+
 /**
  * Overridden maven components:
  * <p/>
@@ -1160,10 +1162,12 @@ public abstract class Maven3XServerEmbedder extends Maven3ServerEmbedder {
       }
     }
     catch (Exception e) {
-      collectProblems(mavenProject.getFile(), Collections.singleton(e),
-                      result == null ? Collections.<ModelProblem>emptyList() : result.getModelProblems(), problems);
+      collectProblems(mavenProject.getFile(), Collections.singleton(e), result.getModelProblems(), problems);
     }
 
+    List<MavenRemoteRepository> remoteRepositories = convertRemoteRepositories(mavenProject.getRemoteArtifactRepositories());
+    model.setRemoteRepositories(remoteRepositories);
+
     RemoteNativeMavenProjectHolder holder = new RemoteNativeMavenProjectHolder(mavenProject);
     try {
       UnicastRemoteObject.exportObject(holder, 0);