1   package org.apache.maven.artifact.resolver;
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  import java.util.List;
24  
25  import org.apache.maven.artifact.Artifact;
26  import org.apache.maven.artifact.repository.ArtifactRepository;
27  
28  
29  
30  
31  public class ArtifactNotFoundException
32      extends AbstractArtifactResolutionException
33  {
34      private String downloadUrl;
35  
36      protected ArtifactNotFoundException( String message, Artifact artifact,
37                                           List<ArtifactRepository> remoteRepositories )
38      {
39          super( message, artifact, remoteRepositories );
40      }
41  
42      public ArtifactNotFoundException( String message, Artifact artifact )
43      {
44          this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(),
45                artifact.getClassifier(), null, artifact.getDownloadUrl(), artifact.getDependencyTrail() );
46      }
47  
48      protected ArtifactNotFoundException( String message, Artifact artifact,
49                                           List<ArtifactRepository> remoteRepositories, Throwable cause )
50      {
51          this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(),
52                artifact.getClassifier(), remoteRepositories, artifact.getDownloadUrl(), artifact.getDependencyTrail(),
53                cause );
54      }
55  
56      @SuppressWarnings( "checkstyle:parameternumber" )
57      public ArtifactNotFoundException( String message, String groupId, String artifactId, String version, String type,
58                                        String classifier, List<ArtifactRepository> remoteRepositories,
59                                        String downloadUrl, List<String> path, Throwable cause )
60      {
61          super( constructMissingArtifactMessage( message, "", groupId, artifactId, version, type, classifier,
62                                                  downloadUrl, path ), groupId, artifactId, version, type, classifier,
63                 remoteRepositories, null, cause );
64  
65          this.downloadUrl = downloadUrl;
66      }
67  
68      @SuppressWarnings( "checkstyle:parameternumber" )
69      private ArtifactNotFoundException( String message, String groupId, String artifactId, String version, String type,
70                                         String classifier, List<ArtifactRepository> remoteRepositories,
71                                         String downloadUrl, List<String> path )
72      {
73          super( constructMissingArtifactMessage( message, "", groupId, artifactId, version, type, classifier,
74                                                  downloadUrl, path ), groupId, artifactId, version, type, classifier,
75                 remoteRepositories, null );
76  
77          this.downloadUrl = downloadUrl;
78      }
79  
80      public String getDownloadUrl()
81      {
82          return downloadUrl;
83      }
84  
85  }