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 import java.io.File;
22 import java.util.Collection;
23 import java.util.List;
24 import java.util.regex.Pattern;
25
26 import org.apache.maven.artifact.handler.ArtifactHandler;
27 import org.apache.maven.artifact.metadata.ArtifactMetadata;
28 import org.apache.maven.artifact.repository.ArtifactRepository;
29 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
30 import org.apache.maven.artifact.versioning.ArtifactVersion;
31 import org.apache.maven.artifact.versioning.OverConstrainedVersionException;
32 import org.apache.maven.artifact.versioning.VersionRange;
33
34
35
36
37
38 public interface Artifact extends Comparable<Artifact> {
39
40
41
42
43
44
45 @Deprecated(since = "4.0.0")
46 String RELEASE_VERSION = "RELEASE";
47
48
49
50
51
52
53 @Deprecated(since = "4.0.0")
54 String LATEST_VERSION = "LATEST";
55
56 String SNAPSHOT_VERSION = "SNAPSHOT";
57
58 Pattern VERSION_FILE_PATTERN = Pattern.compile("^(.*)-(\\d{8}\\.\\d{6})-(\\d+)$");
59
60
61
62 String SCOPE_COMPILE = "compile";
63
64 String SCOPE_COMPILE_PLUS_RUNTIME = "compile+runtime";
65
66 String SCOPE_TEST = "test";
67
68 String SCOPE_RUNTIME = "runtime";
69
70 String SCOPE_RUNTIME_PLUS_SYSTEM = "runtime+system";
71
72 String SCOPE_PROVIDED = "provided";
73
74 String SCOPE_SYSTEM = "system";
75
76 String SCOPE_IMPORT = "import";
77
78 String getGroupId();
79
80 String getArtifactId();
81
82 String getVersion();
83
84 void setVersion(String version);
85
86 String getScope();
87
88 String getType();
89
90 String getClassifier();
91
92 boolean hasClassifier();
93
94 File getFile();
95
96 void setFile(File destination);
97
98 String getBaseVersion();
99
100 void setBaseVersion(String baseVersion);
101
102 String getId();
103
104 String getDependencyConflictId();
105
106 void addMetadata(ArtifactMetadata metadata);
107
108 Collection<ArtifactMetadata> getMetadataList();
109
110 void setRepository(ArtifactRepository remoteRepository);
111
112 ArtifactRepository getRepository();
113
114 void updateVersion(String version, ArtifactRepository localRepository);
115
116 String getDownloadUrl();
117
118 void setDownloadUrl(String downloadUrl);
119
120 ArtifactFilter getDependencyFilter();
121
122 void setDependencyFilter(ArtifactFilter artifactFilter);
123
124 ArtifactHandler getArtifactHandler();
125
126 List<String> getDependencyTrail();
127
128 void setDependencyTrail(List<String> dependencyTrail);
129
130 void setScope(String scope);
131
132 VersionRange getVersionRange();
133
134 void setVersionRange(VersionRange newRange);
135
136 void selectVersion(String version);
137
138 void setGroupId(String groupId);
139
140 void setArtifactId(String artifactId);
141
142 boolean isSnapshot();
143
144 void setResolved(boolean resolved);
145
146 boolean isResolved();
147
148 void setResolvedVersion(String version);
149
150 void setArtifactHandler(ArtifactHandler handler);
151
152 boolean isRelease();
153
154 void setRelease(boolean release);
155
156 List<ArtifactVersion> getAvailableVersions();
157
158 void setAvailableVersions(List<ArtifactVersion> versions);
159
160 boolean isOptional();
161
162 void setOptional(boolean optional);
163
164 ArtifactVersion getSelectedVersion() throws OverConstrainedVersionException;
165
166 boolean isSelectedVersionKnown() throws OverConstrainedVersionException;
167 }