From 4d4cc076c691622710154fd95ec844af0e44f828 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 24 Jul 2014 17:54:09 +0100 Subject: [PATCH] Don't fail hard when settings.xml can't be decrypted by the CLI --- .../SettingsXmlRepositorySystemSessionAutoConfiguration.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/SettingsXmlRepositorySystemSessionAutoConfiguration.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/SettingsXmlRepositorySystemSessionAutoConfiguration.java index 3895637ea6..fad751de34 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/SettingsXmlRepositorySystemSessionAutoConfiguration.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/SettingsXmlRepositorySystemSessionAutoConfiguration.java @@ -47,6 +47,7 @@ import org.eclipse.aether.util.repository.DefaultProxySelector; import org.sonatype.plexus.components.cipher.DefaultPlexusCipher; import org.sonatype.plexus.components.cipher.PlexusCipherException; import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher; +import org.springframework.boot.cli.util.Log; /** * Auto-configuration for a RepositorySystemSession that uses Maven's settings.xml to @@ -76,8 +77,8 @@ public class SettingsXmlRepositorySystemSessionAutoConfiguration implements Settings settings = loadSettings(); SettingsDecryptionResult decryptionResult = decryptSettings(settings); if (!decryptionResult.getProblems().isEmpty()) { - throw new IllegalStateException("Settings decryption failed: " - + decryptionResult.getProblems()); + Log.error("Settings decryption failed: " + decryptionResult.getProblems()); + // Continue - the encrypted credentials may not be used } session.setOffline(settings.isOffline());