use of org.eclipse.aether.graph.Dependency in project jqa-core-framework by buschmais.
the class AetherPluginResolverImpl method createClassLoader.
@Override
public PluginClassLoader createClassLoader(ClassLoader parent, List<Plugin> plugins) {
List<Dependency> requiredPlugins = getRequiredPluginDependencies(plugins);
DependencyResult dependencyResult = resolvePlugins(requiredPlugins);
return new PluginClassLoader(getDependencyURLs(dependencyResult), parent);
}
use of org.eclipse.aether.graph.Dependency in project spf4j by zolyfarkas.
the class MavenRepositoryUtils method resolveArtifactAndDependencies.
public static Set<File> resolveArtifactAndDependencies(final String scope, final String groupId, final String artifactId, final String classifier, final String extension, final String versionExpr, final List<RemoteRepository> repos, final RepositorySystem repositorySystem, final RepositorySystemSession session) throws DependencyResolutionException {
Artifact artifact = new DefaultArtifact(groupId, artifactId, classifier, extension, versionExpr);
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot(new Dependency(artifact, scope));
collectRequest.setRepositories(repos);
DependencyFilter dependencyFilter = DependencyFilterUtils.classpathFilter(scope);
if (classifier != null) {
dependencyFilter = DependencyFilterUtils.andFilter(new ClassifierDependencyFilter(classifier));
}
DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, dependencyFilter);
DependencyResult depresult = repositorySystem.resolveDependencies(session, dependencyRequest);
List<ArtifactResult> artifactResults = depresult.getArtifactResults();
Set<File> result = Sets.newHashSetWithExpectedSize(artifactResults.size());
for (ArtifactResult ar : artifactResults) {
result.add(ar.getArtifact().getFile());
}
return result;
}
Aggregations