public void setupProjects(
      final MavenSession session, final MavenProject project, final ReactorProject reactorProject) {
    TargetPlatformConfiguration configuration =
        (TargetPlatformConfiguration)
            project.getContextValue(TychoConstants.CTX_TARGET_PLATFORM_CONFIGURATION);
    List<Map<String, String>> environments = getEnvironments(configuration);

    CompilerOptions compilerOptions = compilerOptionsManager.getCompilerOptions(project);

    IDependencyMetadata metadata =
        generator.generateMetadata(
            new ReactorArtifactFacade(reactorProject, null),
            environments,
            compilerOptions.getOptionalResolutionAction());
    reactorProject.setDependencyMetadata(null, true, metadata.getMetadata(true));
    reactorProject.setDependencyMetadata(null, false, metadata.getMetadata(false));

    // let external providers contribute additional metadata
    try {
      pluginRealmHelper.execute(
          session,
          project,
          new Runnable() {
            public void run() {
              try {
                for (P2MetadataProvider provider : plexus.lookupList(P2MetadataProvider.class)) {
                  provider.setupProject(session, project, reactorProject);
                }
              } catch (ComponentLookupException e) {
                // have not found anything
              }
            }
          },
          new PluginFilter() {
            public boolean accept(PluginDescriptor descriptor) {
              return isTychoP2Plugin(descriptor);
            }
          });
    } catch (MavenExecutionException e) {
      throw new RuntimeException(e);
    }
  }
Exemplo n.º 2
0
 public void setDependencyMetadata(IDependencyMetadata dependencyMetadata) {
   this.dependencyMetadata = new LinkedHashSet<Object>(dependencyMetadata.getMetadata(true));
   this.secondaryDependencyMetadata =
       new LinkedHashSet<Object>(dependencyMetadata.getMetadata(false));
 }