public CollectResult collectDependencies(RepositorySystemSession session, CollectRequest request)
     throws DependencyCollectionException {
   return dependencyCollector.collectDependencies(session, request);
 }
  @Override
  public CollectResult collectDependencies(RepositorySystemSession session, CollectRequest request)
      throws DependencyCollectionException {

    debugf("collectDependencies %s", request);
    validateSession(session);

    // delegate has been wired up to come back to us, so this must be a real
    // implementation

    DependencyCollectionException originalException = null;

    // TODO: work in progress, we need to aggregate all
    // try JPP local repo
    if (useJpp) {
      // use maven as much as possible
      final RepositorySystemSession alternateSession = openJpp(session);
      try {
        final CollectRequest alternateRequest =
            new CollectRequest(
                    request.getRoot(), request.getDependencies(), singletonList(fossRepository))
                .setManagedDependencies(request.getManagedDependencies())
                .setTrace(request.getTrace());

        final CollectResult result =
            dependencyCollector.collectDependencies(alternateSession, alternateRequest);

        if (result.getExceptions().isEmpty() && result.getRoot() != null) {
          logger.warn("collectDependencies: result from JPP " + result);
          //                    logger.warn("TODO");
          return result;
        }
      } catch (DependencyCollectionException e) {
        logger.debug("JPP collect dependencies of " + request + " failed", e);
        originalException = e;
      }
    }

    // try FOSS local repo
    {
      try {
        final CollectRequest alternateRequest =
            new CollectRequest()
                .setRoot(request.getRoot())
                .setDependencies(request.getDependencies())
                .setManagedDependencies(request.getManagedDependencies())
                .setRequestContext(request.getRequestContext())
                .setTrace(request.getTrace())
                .setRepositories(singletonList(fossRepository));

        final CollectResult result =
            dependencyCollector.collectDependencies(session, alternateRequest);

        logger.debug("collectDependencies: result = " + result);
        if (result.getExceptions().isEmpty()) {
          return result;
        }
      } catch (DependencyCollectionException e) {
        logger.warn("collect dependencies failed ", e);
        if (originalException == null) {
          originalException = e;
        }
      }
    }

    if (originalException != null) {
      throw originalException;
    }

    throw new RuntimeException(
        "NYI: org.fedoraproject.maven.repository.internal."
            + "FossRepositorySystem.collectDependencies");
  }