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