コード例 #1
0
 /**
  * Returns the list of servers with decrypted passwords.
  *
  * @return list of servers with decrypted passwords.
  */
 List<Server> getDecryptedServers() {
   final SettingsDecryptionRequest settingsDecryptionRequest =
       new DefaultSettingsDecryptionRequest();
   settingsDecryptionRequest.setServers(settings.getServers());
   final SettingsDecryptionResult decrypt = settingsDecrypter.decrypt(settingsDecryptionRequest);
   return decrypt.getServers();
 }
コード例 #2
0
  private synchronized Settings getSettings() {
    if (settings == null) {
      DefaultSettingsBuildingRequest request = new DefaultSettingsBuildingRequest();
      request.setUserSettingsFile(getUserSettings());
      request.setGlobalSettingsFile(getGlobalSettings());
      request.setSystemProperties(getSystemProperties());
      request.setUserProperties(getUserProperties());

      try {
        settings = settingsBuilder.build(request).getEffectiveSettings();
      } catch (SettingsBuildingException e) {
        project.log("Could not process settings.xml: " + e.getMessage(), e, Project.MSG_WARN);
      }

      SettingsDecryptionResult result =
          settingsDecrypter.decrypt(new DefaultSettingsDecryptionRequest(settings));
      settings.setServers(result.getServers());
      settings.setProxies(result.getProxies());
    }
    return settings;
  }