Don't fail hard when settings.xml can't be decrypted by the CLI

pull/1332/head
Andy Wilkinson 10 years ago
parent 68163a66a5
commit 4d4cc076c6

@ -47,6 +47,7 @@ import org.eclipse.aether.util.repository.DefaultProxySelector;
import org.sonatype.plexus.components.cipher.DefaultPlexusCipher; import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
import org.sonatype.plexus.components.cipher.PlexusCipherException; import org.sonatype.plexus.components.cipher.PlexusCipherException;
import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher; 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 * Auto-configuration for a RepositorySystemSession that uses Maven's settings.xml to
@ -76,8 +77,8 @@ public class SettingsXmlRepositorySystemSessionAutoConfiguration implements
Settings settings = loadSettings(); Settings settings = loadSettings();
SettingsDecryptionResult decryptionResult = decryptSettings(settings); SettingsDecryptionResult decryptionResult = decryptSettings(settings);
if (!decryptionResult.getProblems().isEmpty()) { if (!decryptionResult.getProblems().isEmpty()) {
throw new IllegalStateException("Settings decryption failed: " Log.error("Settings decryption failed: " + decryptionResult.getProblems());
+ decryptionResult.getProblems()); // Continue - the encrypted credentials may not be used
} }
session.setOffline(settings.isOffline()); session.setOffline(settings.isOffline());

Loading…
Cancel
Save