[FIX][Standalone Server] check if maven settings.xml not exists (#6691)

This commit is contained in:
LiuBodong 2021-11-04 20:17:53 +08:00 committed by GitHub
parent 66fbcae9dd
commit 71047db39e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -138,12 +138,12 @@ public class DolphinPluginManagerConfig {
// get 'settings.xml' from user home
Path settingsXmlPath = getMavenSettingsXmlFromUserHome();
// if user home does not exist settings.xml, get from '$MAVEN_HOME/conf/settings.xml'
if (settingsXmlPath == null) {
if (settingsXmlPath == null || !Files.exists(settingsXmlPath)) {
logger.info("User home does not exists maven settings.xml");
settingsXmlPath = getMavenSettingsXmlFromEvn();
}
// still not exist, return default repository
if (settingsXmlPath == null) {
if (settingsXmlPath == null || !Files.exists(settingsXmlPath)) {
logger.info("Maven home does not exists maven settings.xml, use default");
return defaultRepository;
}