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