Browse Source

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

LiuBodong 3 years ago
parent
commit
71047db39e

+ 2 - 2
dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/plugin/DolphinPluginManagerConfig.java

@@ -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;
         }