code: public static Server getServer(final Settings settings, final String serverId) {
          if (settings == null || StringUtils.isEmpty(serverId)) {
              return null;
          }
          return settings.getServer(serverId);
      }
docs: Get server credential from Maven settings by server Id.
  
  @param settings Maven settings object.
  @param serverId Server Id.
  @return Server object if it exists in settings. Otherwise return null.