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