String () { String defaultMavenFolder = SystemProperties.getUserHome() + File.separator + M2_DIR; // Check user local settings File userSettingsFile = getUserMavenSettingsXml(); if (userSettingsFile.exists()) { String fromUserSettings = getRepositoryFromSettings(userSettingsFile); if (isNotEmpty(fromUserSettings) && new File(fromUserSettings).exists()) { return fromUserSettings; } } // Check global maven local settings File globalSettingsFile = getGlobalMavenSettingsXml(); if (globalSettingsFile != null && globalSettingsFile.exists()) { String fromGlobalSettings = getRepositoryFromSettings(globalSettingsFile); if (isNotEmpty(fromGlobalSettings) && new File(fromGlobalSettings).exists()) { return fromGlobalSettings; } } String defaultMavenRepository = defaultMavenFolder + File.separator + REPOSITORY_PATH; if (FileUtil.exists(defaultMavenFolder)) { return defaultMavenRepository; } return null; }