Search in sources :

Example 6 with DependencyCollectionException

use of org.eclipse.aether.collection.DependencyCollectionException in project fabric8 by jboss-fuse.

the class AetherBasedResolver method resolveDependencies.

protected DependencyNode resolveDependencies(RepositorySystemSession session, List<RemoteRepository> repos, DependencyNode pomNode, Dependency dependency, final Filter<Dependency> shouldExclude) throws FailedToResolveDependency {
    if (!DependencyFilters.matches(dependency, shouldExclude)) {
        CollectRequest cr = new CollectRequest(dependency, repos);
        // request.setRequestContext("runtime");
        try {
            DependencyNode node = m_repoSystem.collectDependencies(session, cr).getRoot();
            DependencyFilter filter = new DependencyFilter() {

                public boolean accept(DependencyNode node, List<DependencyNode> parents) {
                    return !DependencyFilters.matches(node, shouldExclude);
                }
            };
            DependencyRequest request = new DependencyRequest(cr, filter);
            m_repoSystem.resolveDependencies(session, request);
            return node;
        } catch (DependencyResolutionException | DependencyCollectionException e) {
            handleDependencyResolveFailure(pomNode, dependency, e);
        }
    }
    return null;
}
Also used : DependencyCollectionException(org.eclipse.aether.collection.DependencyCollectionException) DependencyRequest(org.eclipse.aether.resolution.DependencyRequest) DefaultDependencyNode(org.eclipse.aether.graph.DefaultDependencyNode) DependencyNode(org.eclipse.aether.graph.DependencyNode) DependencyFilter(org.eclipse.aether.graph.DependencyFilter) ArrayList(java.util.ArrayList) List(java.util.List) LinkedList(java.util.LinkedList) DependencyResolutionException(org.eclipse.aether.resolution.DependencyResolutionException) CollectRequest(org.eclipse.aether.collection.CollectRequest)

Aggregations

DependencyCollectionException (org.eclipse.aether.collection.DependencyCollectionException)6 CollectRequest (org.eclipse.aether.collection.CollectRequest)5 DependencyNode (org.eclipse.aether.graph.DependencyNode)4 DependencyResolutionException (org.eclipse.aether.resolution.DependencyResolutionException)4 Artifact (org.eclipse.aether.artifact.Artifact)3 IOException (java.io.IOException)2 MalformedURLException (java.net.MalformedURLException)2 URL (java.net.URL)2 ArrayList (java.util.ArrayList)2 DefaultArtifact (org.eclipse.aether.artifact.DefaultArtifact)2 CollectResult (org.eclipse.aether.collection.CollectResult)2 Dependency (org.eclipse.aether.graph.Dependency)2 ArtifactResolutionException (org.eclipse.aether.resolution.ArtifactResolutionException)2 DependencyRequest (org.eclipse.aether.resolution.DependencyRequest)2 SimpleMavenCache (gate.util.maven.SimpleMavenCache)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 URLClassLoader (java.net.URLClassLoader)1 FileSystemNotFoundException (java.nio.file.FileSystemNotFoundException)1 Path (java.nio.file.Path)1