@NotNull
  public static File resolveLocalRepository(@Nullable String overriddenLocalRepository,
                                            @NotNull StaticResolvedMavenHomeType mavenHomeType,
                                            @Nullable String overriddenUserSettingsFile) {
    String forcedM2Home = System.getProperty(PROP_FORCED_M2_HOME);
    if (forcedM2Home != null) {
      MavenLog.LOG.error(PROP_FORCED_M2_HOME + " is deprecated, use maven.repo.local property instead");
      return new File(forcedM2Home);
    }
    File result = null;
    if (!isEmptyOrSpaces(overriddenLocalRepository)) result = new File(overriddenLocalRepository);

    String localRepoHome = System.getProperty(MAVEN_REPO_LOCAL);
    if (localRepoHome != null) {
      MavenLog.LOG.debug("Using " + MAVEN_REPO_LOCAL + "=" + localRepoHome);
      return new File(localRepoHome);
    }
    if (result == null) {
      result = doResolveLocalRepository(resolveUserSettingsFile(overriddenUserSettingsFile),
                                        resolveGlobalSettingsFile(mavenHomeType));

      if (result == null) {
        result = new File(resolveM2Dir(), REPOSITORY_DIR);
      }
    }
    try {
      return result.getCanonicalFile();
    }
    catch (IOException e) {
      return result;
    }
  }
@NotNull
  public static File resolveLocalRepository(@Nullable String overriddenLocalRepository,
                                            @NotNull StaticResolvedMavenHomeType mavenHomeType,
                                            @Nullable String overriddenUserSettingsFile)