Optimization: build(File, ProjectBuildingRequest) does not use cache. We need to... idea/132.518
authorSergey Evdokimov <sergey.evdokimov@jetbrains.com>
Thu, 3 Oct 2013 14:58:02 +0000 (18:58 +0400)
committerSergey Evdokimov <sergey.evdokimov@jetbrains.com>
Thu, 3 Oct 2013 14:58:33 +0000 (18:58 +0400)
plugins/maven/maven3-server-impl/src/org/jetbrains/idea/maven/server/Maven3ServerEmbedderImpl.java

index 6a8b52809b6ad668b658fdddda80e1b9f4b4232e..bffa0403e26cd0497b111bdd4db82bf1f9d1bf8a 100644 (file)
@@ -328,8 +328,12 @@ public class Maven3ServerEmbedderImpl extends MavenRemoteObject implements Maven
         try {
           // copied from DefaultMavenProjectBuilder.buildWithDependencies
           ProjectBuilder builder = getComponent(ProjectBuilder.class);
-          ProjectBuildingResult buildingResult = builder.build(new File(file.getPath()), request.getProjectBuildingRequest());
-          //builder.calculateConcreteState(project, config, false);
+
+          // Don't use build(File projectFile, ProjectBuildingRequest request) , because it don't use cache !!!!!!!! (see http://devnet.jetbrains.com/message/5500218)
+          List<ProjectBuildingResult> results =
+            builder.build(Collections.singletonList(new File(file.getPath())), false, request.getProjectBuildingRequest());
+
+          ProjectBuildingResult buildingResult = results.get(0);
 
           MavenProject project = buildingResult.getProject();