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