use of org.eclipse.tycho.core.maven.utils.PluginRealmHelper.PluginFilter in project tycho by eclipse.
the class P2DependencyResolver method getDependencyMetadata.
protected Map<String, IDependencyMetadata> getDependencyMetadata(final MavenSession session, final MavenProject project, final List<TargetEnvironment> environments, final OptionalResolutionAction optionalAction) {
final Map<String, IDependencyMetadata> metadata = new LinkedHashMap<>();
metadata.put(null, generator.generateMetadata(new AttachedArtifact(project, project.getBasedir(), null), environments, optionalAction));
// let external providers contribute additional metadata
try {
pluginRealmHelper.execute(session, project, new Runnable() {
@Override
public void run() {
try {
for (P2MetadataProvider provider : plexus.lookupList(P2MetadataProvider.class)) {
Map<String, IDependencyMetadata> providedMetadata = provider.getDependencyMetadata(session, project, null, optionalAction);
if (providedMetadata != null) {
metadata.putAll(providedMetadata);
}
}
} catch (ComponentLookupException e) {
// have not found anything
}
}
}, new PluginFilter() {
@Override
public boolean accept(PluginDescriptor descriptor) {
return isTychoP2Plugin(descriptor);
}
});
} catch (MavenExecutionException e) {
throw new RuntimeException(e);
}
return metadata;
}
Aggregations