1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.artifact;
20
21
22
23
24
25 public class InvalidArtifactRTException extends RuntimeException {
26
27 private final String groupId;
28 private final String artifactId;
29 private final String version;
30 private final String type;
31 private final String baseMessage;
32
33 public InvalidArtifactRTException(String groupId, String artifactId, String version, String type, String message) {
34 this.groupId = groupId;
35 this.artifactId = artifactId;
36 this.version = version;
37 this.type = type;
38 this.baseMessage = message;
39 }
40
41 public InvalidArtifactRTException(
42 String groupId, String artifactId, String version, String type, String message, Throwable cause) {
43 super(cause);
44
45 this.groupId = groupId;
46 this.artifactId = artifactId;
47 this.version = version;
48 this.type = type;
49 this.baseMessage = message;
50 }
51
52 public String getMessage() {
53 return "For artifact {" + getArtifactKey() + "}: " + getBaseMessage();
54 }
55
56 public String getBaseMessage() {
57 return baseMessage;
58 }
59
60 public String getArtifactId() {
61 return artifactId;
62 }
63
64 public String getGroupId() {
65 return groupId;
66 }
67
68 public String getType() {
69 return type;
70 }
71
72 public String getVersion() {
73 return version;
74 }
75
76 public String getArtifactKey() {
77 return groupId + ":" + artifactId + ":" + version + ":" + type;
78 }
79 }