static @NotNull Path resolve(@NotNull String path, @NotNull Path baseDir) {
    Path root;
    int startIndex;
    if (path.startsWith(PROJECT_DIR_MACRO)) {
      root = getProjectDirPath(baseDir);
      startIndex = PROJECT_DIR_MACRO.length();
    }
    else if (path.startsWith(MAVEN_REPO_MACRO)) {
      root = getMavenRepositoryPath();
      startIndex = MAVEN_REPO_MACRO.length();
    }
    else {
      throw new MalformedRepositoryException("Unknown macro in " + path);
    }
    if (path.length() <= startIndex + 1 || path.charAt(startIndex) != '/') {
      throw new MalformedRepositoryException("Incorrect macro usage in " + path);
    }
    if (path.contains("/../") || path.endsWith("/..")) {
      throw new MalformedRepositoryException("Path '" + path + "' points to a file outside macro directory");
    }
    return root.resolve(path.substring(startIndex + 1));
  }
static @NotNull Path resolve(@NotNull String path, @NotNull Path baseDir)