private void processRepositories() throws AmbariException {
    List<RepositoryInfo> stackRepos = Collections.emptyList();
    RepositoryXml rxml = stackDirectory.getRepoFile();

    if (null != rxml) {
      stackInfo.setRepositoryXml(rxml);

      LOG.debug("Adding repositories to stack, stackName={}, stackVersion={}, repoFolder={}",
        stackInfo.getName(), stackInfo.getVersion(), stackDirectory.getRepoDir());

      stackRepos = rxml.getRepositories();


      stackInfo.getRepositories().addAll(stackRepos);
    }

    LOG.debug("Process service custom repositories");
    Collection<RepositoryInfo> serviceRepos = getUniqueServiceRepos(stackRepos);
    stackInfo.getRepositories().addAll(serviceRepos);

    if (null != rxml && null != rxml.getLatestURI() && stackRepos.size() > 0) {
      registerRepoUpdateTask(rxml);
    }
  }
Process repositories associated with the stack.
@throws AmbariException if unable to fully process the stack repositories
ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java