File (@Nullable String overriddenLocalRepository, @NotNull StaticResolvedMavenHomeType mavenHomeType, @Nullable String overriddenUserSettingsFile) { String forcedM2Home = System.getProperty(PROP_FORCED_M2_HOME); if (forcedM2Home != null) { return new File(forcedM2Home); } File result = null; if (!isEmptyOrSpaces(overriddenLocalRepository)) result = new File(overriddenLocalRepository); 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; } }