List of usage examples for org.apache.maven.settings.building SettingsProblem getException
Exception getException();
From source file:org.debian.dependency.sources.SCMSourceRetrieval.java
License:Apache License
@Override public String retrieveSource(final Artifact artifact, final File directory, final MavenSession session) throws SourceRetrievalException { MavenProject project = findProjectRoot(constructProject(artifact, session)); Scm scm = project.getScm();/*from w ww . j a va 2 s .c o m*/ if (scm == null) { return null; } SettingsDecryptionResult decryptionResult = settingsDecrypter .decrypt(new DefaultSettingsDecryptionRequest(session.getSettings())); for (SettingsProblem problem : decryptionResult.getProblems()) { getLogger().warn("Error decrypting settings (" + problem.getLocation() + ") : " + problem.getMessage(), problem.getException()); } try { // first we check developer connection CheckOutScmResult checkoutResult = null; String connection = scm.getDeveloperConnection(); try { checkoutResult = performCheckout(connection, determineVersion(scm), directory, decryptionResult.getServers()); } catch (ScmException e) { // we don't really care about the exception here because we will try the regular connection next getLogger().debug( "Unable to checkout sources using developer connection, trying standard connection", e); } // now the regular connection if it wasn't successful if (checkoutResult == null || !checkoutResult.isSuccess()) { connection = scm.getConnection(); checkoutResult = performCheckout(connection, determineVersion(scm), directory, decryptionResult.getServers()); } if (checkoutResult == null) { throw new SourceRetrievalException("No scm information available"); } else if (!checkoutResult.isSuccess()) { getLogger().error("Provider Message:"); getLogger().error(StringUtils.defaultString(checkoutResult.getProviderMessage())); getLogger().error("Commandline:"); getLogger().error(StringUtils.defaultString(checkoutResult.getCommandOutput())); throw new SourceRetrievalException("Unable to checkout files: " + StringUtils.defaultString(checkoutResult.getProviderMessage())); } return connection; } catch (ScmException e) { throw new SourceRetrievalException("Unable to checkout project", e); } }
From source file:org.eclipse.ebr.maven.EclipseIpLogUtil.java
License:Open Source License
private Server getServer(final String serverId, final Settings settings, final SettingsDecrypter settingsDecrypter) { for (Server server : settings.getServers()) { if (StringUtils.equals(server.getId(), serverId)) { final SettingsDecryptionRequest request = new DefaultSettingsDecryptionRequest(server); final SettingsDecryptionResult result = settingsDecrypter.decrypt(request); server = result.getServer(); // log any detected problems for (final SettingsProblem problem : result.getProblems()) { getLog().warn(problem.getMessage(), problem.getException()); }//from www .ja v a 2 s. co m return server; } } return null; }
From source file:org.eclipse.m2e.core.internal.embedder.MavenImpl.java
License:Open Source License
public Server decryptPassword(Server server) throws CoreException { SettingsDecryptionRequest request = new DefaultSettingsDecryptionRequest(server); SettingsDecryptionResult result = lookup(SettingsDecrypter.class).decrypt(request); for (SettingsProblem problem : result.getProblems()) { log.warn(problem.getMessage(), problem.getException()); }/*from www . ja v a 2 s .c om*/ return result.getServer(); }
From source file:org.springframework.ide.vscode.commons.maven.MavenBridge.java
License:Open Source License
public Server decryptPassword(Server server) throws MavenException { SettingsDecryptionRequest request = new DefaultSettingsDecryptionRequest(server); SettingsDecryptionResult result = lookup(SettingsDecrypter.class).decrypt(request); for (SettingsProblem problem : result.getProblems()) { log.warn(problem.getMessage(), problem.getException()); }/* www . j a va 2s . co m*/ return result.getServer(); }