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 org.apache.maven.artifact.Artifact;
23  import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
24  import org.apache.maven.artifact.repository.ArtifactRepository;
25  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
26  
27  import java.util.List;
28  import java.util.Map;
29  import java.util.Set;
30  
31  /**
32   * I want to use it for hidding the fact that sometime artifact must be
33   * downloaded. I am just asking LocalRepository for given artifact and I don't
34   * care if it is alredy there or how it will get there.
35   *
36   * @author <a href="michal.maczka@dimatics.com">Michal Maczka </a>
37   * @version $Id: ArtifactResolver.java 495147 2007-01-11 07:47:53Z jvanzyl $
38   * @todo possibly fix the signatures, it's unfortunate that in some methods the local repo is listed first and second in others.
39   */
40  public interface ArtifactResolver
41  {
42      String ROLE = ArtifactResolver.class.getName();
43  
44      void resolve( Artifact artifact, List remoteRepositories, ArtifactRepository localRepository )
45          throws ArtifactResolutionException, ArtifactNotFoundException;
46  
47      ArtifactResolutionResult resolveTransitively( Set artifacts,
48                                                    Artifact originatingArtifact,
49                                                    List remoteRepositories,
50                                                    ArtifactRepository localRepository,
51                                                    ArtifactMetadataSource source )
52          throws ArtifactResolutionException, ArtifactNotFoundException;
53  
54      ArtifactResolutionResult resolveTransitively( Set artifacts,
55                                                    Artifact originatingArtifact,
56                                                    List remoteRepositories,
57                                                    ArtifactRepository localRepository,
58                                                    ArtifactMetadataSource source,
59                                                    List listeners )
60          throws ArtifactResolutionException, ArtifactNotFoundException;
61  
62      ArtifactResolutionResult resolveTransitively( Set artifacts,
63                                                    Artifact originatingArtifact,
64                                                    ArtifactRepository localRepository,
65                                                    List remoteRepositories,
66                                                    ArtifactMetadataSource source,
67                                                    ArtifactFilter filter )
68          throws ArtifactResolutionException, ArtifactNotFoundException;
69  
70      ArtifactResolutionResult resolveTransitively( Set artifacts,
71                                                    Artifact originatingArtifact,
72                                                    Map managedVersions,
73                                                    ArtifactRepository localRepository,
74                                                    List remoteRepositories,
75                                                    ArtifactMetadataSource source )
76          throws ArtifactResolutionException, ArtifactNotFoundException;
77  
78      ArtifactResolutionResult resolveTransitively( Set artifacts,
79                                                    Artifact originatingArtifact,
80                                                    Map managedVersions,
81                                                    ArtifactRepository localRepository,
82                                                    List remoteRepositories,
83                                                    ArtifactMetadataSource source, ArtifactFilter filter )
84          throws ArtifactResolutionException, ArtifactNotFoundException;
85  
86      ArtifactResolutionResult resolveTransitively( Set artifacts,
87                                                    Artifact originatingArtifact,
88                                                    Map managedVersions,
89                                                    ArtifactRepository localRepository,
90                                                    List remoteRepositories,
91                                                    ArtifactMetadataSource source,
92                                                    ArtifactFilter filter,
93                                                    List listeners )
94          throws ArtifactResolutionException, ArtifactNotFoundException;
95  
96      void resolveAlways( Artifact artifact, List remoteRepositories, ArtifactRepository localRepository )
97          throws ArtifactResolutionException, ArtifactNotFoundException;
98  }