private void ensurePomFileExists() {
    File f = myWrapee.getFile();
    if (f == null || f.exists()) return;

    isStub = true;

    ourCacheReadLock.lock();
    try {
      f = ourStubCache.get(getId());
    }
    finally {
      ourCacheReadLock.unlock();
    }

    if (f != null) {
      myWrapee.setFile(f);
      return;
    }

    ourCacheWriteLock.lock();
    try {
      f = ourStubCache.get(getId());
      if (f != null) {
        myWrapee.setFile(f);
        return;
      }

      f = FileUtilRt.createTempFile("idea.maven.stub", ".pom");
      f.deleteOnExit();

      FileOutputStream s = new FileOutputStream(f);
      PrintWriter w = new PrintWriter(s);
      try {
        w.println("<project>");
        w.println("<modelVersion>4.0.0</modelVersion>");
        w.println("<packaging>pom</packaging>");
        w.println("<groupId>" + getGroupId() + "</groupId>");
        w.println("<artifactId>" + getArtifactId() + "</artifactId>");
        w.println("<version>" + getVersion() + "</version>");
        w.println("</project>");
        w.flush();
      }
      finally {
        w.close();
        s.close();
      }

      myWrapee.setFile(f);
      ourStubCache.put(getId(), f);
    }
    catch (IOException e) {
      // todo
      //try {
      //  MavenFacadeGlobalsManager.getLogger().warn(e);
      //}
      //catch (RemoteException e1) {
      //  throw new RuntimeRemoteException(e1);
      //}
    }
    finally {
      ourCacheWriteLock.unlock();
    }
  }
private void ensurePomFileExists()