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