1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugin.testing.stubs;
20
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
24
25 import org.apache.maven.artifact.Artifact;
26 import org.apache.maven.artifact.metadata.ArtifactMetadata;
27 import org.apache.maven.artifact.repository.ArtifactRepository;
28 import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
29 import org.apache.maven.artifact.repository.Authentication;
30 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
31 import org.apache.maven.repository.Proxy;
32
33
34
35
36 public class StubArtifactRepository implements ArtifactRepository {
37 private String baseDir = null;
38
39
40
41
42
43
44 public StubArtifactRepository(String dir) {
45 baseDir = dir;
46 }
47
48
49
50
51
52 @Override
53 public String pathOf(Artifact artifact) {
54 return artifact.getId();
55 }
56
57
58
59
60
61 @Override
62 public String pathOfRemoteRepositoryMetadata(ArtifactMetadata artifactMetadata) {
63 return null;
64 }
65
66
67
68
69
70 @Override
71 public String pathOfLocalRepositoryMetadata(ArtifactMetadata metadata, ArtifactRepository repository) {
72 return metadata.getLocalFilename(repository);
73 }
74
75
76
77
78
79 @Override
80 public String getUrl() {
81 return null;
82 }
83
84
85
86
87
88 @Override
89 public String getBasedir() {
90 return baseDir;
91 }
92
93
94
95
96
97 @Override
98 public String getProtocol() {
99 return null;
100 }
101
102
103
104
105
106 @Override
107 public String getId() {
108 return null;
109 }
110
111
112
113
114
115 @Override
116 public ArtifactRepositoryPolicy getSnapshots() {
117 return null;
118 }
119
120
121
122
123
124 @Override
125 public ArtifactRepositoryPolicy getReleases() {
126 return null;
127 }
128
129
130
131
132
133 @Override
134 public ArtifactRepositoryLayout getLayout() {
135 return null;
136 }
137
138
139
140
141
142 @Override
143 public String getKey() {
144 return null;
145 }
146
147
148
149
150
151 @Override
152 public boolean isUniqueVersion() {
153 return false;
154 }
155
156
157
158
159
160
161 @Override
162 public void setBlacklisted(boolean blackListed) {
163
164 }
165
166
167
168
169
170 @Override
171 public boolean isBlacklisted() {
172 return false;
173 }
174
175 @Override
176 public Artifact find(Artifact artifact) {
177
178 return null;
179 }
180
181 @Override
182 public Authentication getAuthentication() {
183 return null;
184 }
185
186 @Override
187 public Proxy getProxy() {
188 return null;
189 }
190
191 @Override
192 public void setAuthentication(Authentication authentication) {}
193
194 @Override
195 public void setId(String id) {}
196
197 @Override
198 public void setLayout(ArtifactRepositoryLayout layout) {}
199
200 @Override
201 public void setProxy(Proxy proxy) {}
202
203 @Override
204 public void setReleaseUpdatePolicy(ArtifactRepositoryPolicy policy) {}
205
206 @Override
207 public void setSnapshotUpdatePolicy(ArtifactRepositoryPolicy policy) {}
208
209 @Override
210 public void setUrl(String url) {}
211
212 @Override
213 public List<String> findVersions(Artifact artifact) {
214 return Collections.emptyList();
215 }
216
217 @Override
218 public boolean isProjectAware() {
219 return false;
220 }
221
222 @Override
223 public List<ArtifactRepository> getMirroredRepositories() {
224 return new ArrayList<>(0);
225 }
226
227 @Override
228 public void setMirroredRepositories(List<ArtifactRepository> artifactRepositories) {
229
230 }
231
232 @Override
233 public boolean isBlocked() {
234 return false;
235 }
236
237 @Override
238 public void setBlocked(boolean blocked) {
239
240 }
241 }