private void addPomDependenciesToTargetPlatform(
      MavenProject project,
      TargetPlatformBuilder resolutionContext,
      List<ReactorProject> reactorProjects,
      MavenSession session) {
    Set<String> projectIds = new HashSet<String>();
    for (ReactorProject p : reactorProjects) {
      String key = ArtifactUtils.key(p.getGroupId(), p.getArtifactId(), p.getVersion());
      projectIds.add(key);
    }

    ArrayList<String> scopes = new ArrayList<String>();
    scopes.add(Artifact.SCOPE_COMPILE);
    Collection<Artifact> artifacts;
    try {
      artifacts = projectDependenciesResolver.resolve(project, scopes, session);
    } catch (MultipleArtifactsNotFoundException e) {
      Collection<Artifact> missing = new HashSet<Artifact>(e.getMissingArtifacts());

      for (Iterator<Artifact> it = missing.iterator(); it.hasNext(); ) {
        Artifact a = it.next();
        String key = ArtifactUtils.key(a.getGroupId(), a.getArtifactId(), a.getBaseVersion());
        if (projectIds.contains(key)) {
          it.remove();
        }
      }

      if (!missing.isEmpty()) {
        throw new RuntimeException("Could not resolve project dependencies", e);
      }

      artifacts = e.getResolvedArtifacts();
      artifacts.removeAll(e.getMissingArtifacts());
    } catch (AbstractArtifactResolutionException e) {
      throw new RuntimeException("Could not resolve project dependencies", e);
    }
    List<Artifact> externalArtifacts = new ArrayList<Artifact>(artifacts.size());
    for (Artifact artifact : artifacts) {
      String key =
          ArtifactUtils.key(
              artifact.getGroupId(), artifact.getArtifactId(), artifact.getBaseVersion());
      if (projectIds.contains(key)) {
        // resolved to an older snapshot from the repo, we only want the current project in the
        // reactor
        continue;
      }
      externalArtifacts.add(artifact);
    }
    List<Artifact> explicitArtifacts =
        MavenDependencyInjector.filterInjectedDependencies(
            externalArtifacts); // needed when the resolution is done again for the test runtime
    PomDependencyProcessor pomDependencyProcessor =
        new PomDependencyProcessor(
            session,
            repositorySystem,
            equinox.getService(LocalRepositoryP2Indices.class),
            getLogger());
    pomDependencyProcessor.addPomDependenciesToResolutionContext(
        project, explicitArtifacts, resolutionContext);
  }
 public void injectDependenciesIntoMavenModel(
     MavenProject project,
     AbstractTychoProject projectType,
     DependencyArtifacts dependencyArtifacts,
     Logger logger) {
   MavenDependencyInjector.injectMavenDependencies(
       project, dependencyArtifacts, bundleReader, logger);
 }