View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
3    * agreements. See the NOTICE file distributed with this work for additional information regarding
4    * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with the License. You may obtain a
6    * copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software distributed under the License
11   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing permissions and limitations under
13   * the License.
14   */
15  
16  package org.apache.maven.lifecycle.internal.stub;
17  
18  import org.apache.maven.ProjectDependenciesResolver;
19  import org.apache.maven.artifact.Artifact;
20  import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
21  import org.apache.maven.artifact.resolver.ArtifactResolutionException;
22  import org.apache.maven.execution.MavenSession;
23  import org.apache.maven.project.DependencyResolutionException;
24  import org.apache.maven.project.DependencyResolutionRequest;
25  import org.apache.maven.project.DependencyResolutionResult;
26  import org.apache.maven.project.MavenProject;
27  import org.eclipse.aether.graph.DefaultDependencyNode;
28  import org.eclipse.aether.graph.Dependency;
29  import org.eclipse.aether.graph.DependencyNode;
30  
31  import java.util.Collection;
32  import java.util.Collections;
33  import java.util.HashSet;
34  import java.util.List;
35  import java.util.Set;
36  
37  /**
38   * @author Kristian Rosenvold
39   */
40  public class ProjectDependenciesResolverStub
41      implements ProjectDependenciesResolver, org.apache.maven.project.ProjectDependenciesResolver
42  {
43      public Set<Artifact> resolve( MavenProject project, Collection<String> scopesToResolve, MavenSession session )
44          throws ArtifactResolutionException, ArtifactNotFoundException
45      {
46          return new HashSet<>();
47      }
48  
49      public Set<Artifact> resolve( MavenProject project, Collection<String> scopesToCollect,
50                                    Collection<String> scopesToResolve, MavenSession session )
51          throws ArtifactResolutionException, ArtifactNotFoundException
52      {
53          return new HashSet<>();
54      }
55  
56      public Set<Artifact> resolve( Collection<? extends MavenProject> projects, Collection<String> scopes,
57                                    MavenSession session )
58          throws ArtifactResolutionException, ArtifactNotFoundException
59      {
60          return new HashSet<>();
61      }
62  
63      public Set<Artifact> resolve( MavenProject project, Collection<String> scopesToCollect,
64                                    Collection<String> scopesToResolve, MavenSession session,
65                                    Set<Artifact> ignoreableArtifacts )
66          throws ArtifactResolutionException, ArtifactNotFoundException
67      {
68          return new HashSet<>();
69      }
70  
71      public DependencyResolutionResult resolve( DependencyResolutionRequest request )
72          throws DependencyResolutionException
73      {
74          return new DependencyResolutionResult()
75          {
76  
77              public List<Dependency> getUnresolvedDependencies()
78              {
79                  return Collections.emptyList();
80              }
81  
82              public List<Dependency> getResolvedDependencies()
83              {
84                  return Collections.emptyList();
85              }
86  
87              public List<Exception> getResolutionErrors( Dependency dependency )
88              {
89                  return Collections.emptyList();
90              }
91  
92              public DependencyNode getDependencyGraph()
93              {
94                  return new DefaultDependencyNode( (Dependency) null );
95              }
96  
97              public List<Dependency> getDependencies()
98              {
99                  return Collections.emptyList();
100             }
101 
102             public List<Exception> getCollectionErrors()
103             {
104                 return Collections.emptyList();
105             }
106         };
107     }
108 
109 }