View Javadoc
1   package org.apache.maven.artifact.resolver;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.List;
23  import java.util.Map;
24  import java.util.Set;
25  
26  import org.apache.maven.artifact.Artifact;
27  import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
28  import org.apache.maven.artifact.repository.ArtifactRepository;
29  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
30  import org.apache.maven.wagon.events.TransferListener;
31  
32  /**
33   * @author Jason van Zyl
34   */
35  // Just hide the one method we want behind the RepositorySystem interface.
36  public interface ArtifactResolver
37  {
38  
39      ArtifactResolutionResult resolve( ArtifactResolutionRequest request );
40  
41      // The rest is deprecated
42      // USED BY MAVEN ASSEMBLY PLUGIN 2.2-beta-2
43      @Deprecated
44      String ROLE = ArtifactResolver.class.getName();
45  
46      // USED BY SUREFIRE, DEPENDENCY PLUGIN
47      @Deprecated
48      ArtifactResolutionResult resolveTransitively(
49          Set<Artifact> artifacts, Artifact originatingArtifact,
50          ArtifactRepository localRepository,
51          List<ArtifactRepository> remoteRepositories,
52          ArtifactMetadataSource source, ArtifactFilter filter )
53          throws ArtifactResolutionException, ArtifactNotFoundException;
54  
55      // USED BY MAVEN ASSEMBLY PLUGIN
56      @Deprecated
57      ArtifactResolutionResult resolveTransitively(
58          Set<Artifact> artifacts, Artifact originatingArtifact,
59          Map<String, Artifact> managedVersions, ArtifactRepository localRepository,
60          List<ArtifactRepository> remoteRepositories,
61          ArtifactMetadataSource source )
62          throws ArtifactResolutionException, ArtifactNotFoundException;
63  
64      // USED BY MAVEN ASSEMBLY PLUGIN
65      @Deprecated
66      ArtifactResolutionResult resolveTransitively(
67          Set<Artifact> artifacts, Artifact originatingArtifact,
68          Map<String, Artifact> managedVersions, ArtifactRepository localRepository,
69          List<ArtifactRepository> remoteRepositories,
70          ArtifactMetadataSource source, ArtifactFilter filter )
71          throws ArtifactResolutionException, ArtifactNotFoundException;
72  
73      // USED BY INVOKER PLUGIN
74      @Deprecated
75      ArtifactResolutionResult resolveTransitively(
76          Set<Artifact> artifacts, Artifact originatingArtifact,
77          List<ArtifactRepository> remoteRepositories,
78          ArtifactRepository localRepository, ArtifactMetadataSource source )
79          throws ArtifactResolutionException, ArtifactNotFoundException;
80  
81      @Deprecated
82      ArtifactResolutionResult resolveTransitively(
83          Set<Artifact> artifacts, Artifact originatingArtifact,
84          Map<String, Artifact> managedVersions, ArtifactRepository localRepository,
85          List<ArtifactRepository> remoteRepositories,
86          ArtifactMetadataSource source, ArtifactFilter filter,
87          List<ResolutionListener> listeners )
88          throws ArtifactResolutionException, ArtifactNotFoundException;
89  
90      @Deprecated
91      ArtifactResolutionResult resolveTransitively(
92          Set<Artifact> artifacts, Artifact originatingArtifact,
93          List<ArtifactRepository> remoteRepositories,
94          ArtifactRepository localRepository, ArtifactMetadataSource source,
95          List<ResolutionListener> listeners )
96          throws ArtifactResolutionException, ArtifactNotFoundException;
97  
98      // USED BY REMOTE RESOURCES PLUGIN, DEPENDENCY PLUGIN, SHADE PLUGIN
99      @Deprecated
100     void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
101         throws ArtifactResolutionException, ArtifactNotFoundException;
102 
103     // USED BY REMOTE RESOURCES PLUGIN
104     @Deprecated
105     void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository,
106                   TransferListener downloadMonitor )
107         throws ArtifactResolutionException, ArtifactNotFoundException;
108 
109     // USED BY DEPENDENCY PLUGIN, ARCHETYPE DOWNLOADER
110     @Deprecated
111     void resolveAlways( Artifact artifact, List<ArtifactRepository> remoteRepositories,
112                         ArtifactRepository localRepository )
113         throws ArtifactResolutionException, ArtifactNotFoundException;
114 
115 }