Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: f1e6add910c363c986ec15eaf74eb55118b4cf26 (plain) (blame)
1
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
/*******************************************************************************
 * Copyright (c) 2013 Igor Fedorenko
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *      Igor Fedorenko - initial API and implementation
 *******************************************************************************/

package org.eclipse.m2e.core.internal.embedder;

import java.io.File;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Properties;

import org.eclipse.aether.RepositoryCache;
import org.eclipse.aether.repository.WorkspaceReader;
import org.eclipse.aether.transfer.TransferListener;

import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.execution.ExecutionListener;
import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.model.Profile;
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.settings.Mirror;
import org.apache.maven.settings.Proxy;
import org.apache.maven.settings.Server;


/**
 * Read-only MavenExecutionRequest that throws IllegalStateException from all modifiers.
 * 
 * @since 1.4
 */
class ReadonlyMavenExecutionRequest implements MavenExecutionRequest {

  private final MavenExecutionRequest request;

  public ReadonlyMavenExecutionRequest(MavenExecutionRequest request) {
    this.request = request;
  }

  public MavenExecutionRequest setBaseDirectory(File basedir) {
    throw new IllegalStateException();
  }

  public String getBaseDirectory() {
    return request.getBaseDirectory();
  }

  public MavenExecutionRequest setStartTime(Date start) {
    throw new IllegalStateException();
  }

  public Date getStartTime() {
    return request.getStartTime();
  }

  public MavenExecutionRequest setGoals(List<String> goals) {
    throw new IllegalStateException();
  }

  public List<String> getGoals() {
    return Collections.unmodifiableList(request.getGoals());
  }

  public MavenExecutionRequest setSystemProperties(Properties systemProperties) {
    throw new IllegalStateException();
  }

  public Properties getSystemProperties() {
    // TODO unmodifiable properties?
    return request.getSystemProperties();
  }

  public MavenExecutionRequest setUserProperties(Properties userProperties) {
    throw new IllegalStateException();
  }

  public Properties getUserProperties() {
    // TODO unmodifiable properties?
    return request.getUserProperties();
  }

  public MavenExecutionRequest setReactorFailureBehavior(String failureBehavior) {
    throw new IllegalStateException();
  }

  public String getReactorFailureBehavior() {
    return request.getReactorFailureBehavior();
  }

  public MavenExecutionRequest setSelectedProjects(List<String> projects) {
    throw new IllegalStateException();
  }

  public List<String> getSelectedProjects() {
    return Collections.unmodifiableList(request.getSelectedProjects());
  }

  public MavenExecutionRequest setResumeFrom(String project) {
    throw new IllegalStateException();
  }

  public String getResumeFrom() {
    return request.getResumeFrom();
  }

  public MavenExecutionRequest setMakeBehavior(String makeBehavior) {
    throw new IllegalStateException();
  }

  public String getMakeBehavior() {
    return request.getMakeBehavior();
  }

  public MavenExecutionRequest setRecursive(boolean recursive) {
    throw new IllegalStateException();
  }

  public boolean isRecursive() {
    return request.isRecursive();
  }

  public MavenExecutionRequest setPom(File pom) {
    throw new IllegalStateException();
  }

  public File getPom() {
    return request.getPom();
  }

  public MavenExecutionRequest setShowErrors(boolean showErrors) {
    throw new IllegalStateException();
  }

  public boolean isShowErrors() {
    return request.isShowErrors();
  }

  public MavenExecutionRequest setTransferListener(TransferListener transferListener) {
    throw new IllegalStateException();
  }

  public TransferListener getTransferListener() {
    return request.getTransferListener();
  }

  public MavenExecutionRequest setLoggingLevel(int loggingLevel) {
    throw new IllegalStateException();
  }

  public int getLoggingLevel() {
    return request.getLoggingLevel();
  }

  public MavenExecutionRequest setUpdateSnapshots(boolean updateSnapshots) {
    throw new IllegalStateException();
  }

  public boolean isUpdateSnapshots() {
    return request.isUpdateSnapshots();
  }

  public MavenExecutionRequest setNoSnapshotUpdates(boolean noSnapshotUpdates) {
    throw new IllegalStateException();
  }

  public boolean isNoSnapshotUpdates() {
    return request.isNoSnapshotUpdates();
  }

  public MavenExecutionRequest setGlobalChecksumPolicy(String globalChecksumPolicy) {
    throw new IllegalStateException();
  }

  public String getGlobalChecksumPolicy() {
    return request.getGlobalChecksumPolicy();
  }

  public MavenExecutionRequest setLocalRepositoryPath(String localRepository) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest setLocalRepositoryPath(File localRepository) {
    throw new IllegalStateException();
  }

  public File getLocalRepositoryPath() {
    return request.getLocalRepositoryPath();
  }

  public MavenExecutionRequest setLocalRepository(ArtifactRepository repository) {
    throw new IllegalStateException();
  }

  public ArtifactRepository getLocalRepository() {
    return request.getLocalRepository();
  }

  public MavenExecutionRequest setInteractiveMode(boolean interactive) {
    throw new IllegalStateException();
  }

  public boolean isInteractiveMode() {
    return request.isInteractiveMode();
  }

  public MavenExecutionRequest setOffline(boolean offline) {
    throw new IllegalStateException();
  }

  public boolean isOffline() {
    return request.isOffline();
  }

  public boolean isCacheTransferError() {
    return request.isCacheTransferError();
  }

  public MavenExecutionRequest setCacheTransferError(boolean cacheTransferError) {
    throw new IllegalStateException();
  }

  public boolean isCacheNotFound() {
    return request.isCacheNotFound();
  }

  public MavenExecutionRequest setCacheNotFound(boolean cacheNotFound) {
    throw new IllegalStateException();
  }

  public List<Profile> getProfiles() {
    return Collections.unmodifiableList(request.getProfiles());
  }

  public MavenExecutionRequest addProfile(Profile profile) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest setProfiles(List<Profile> profiles) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest addActiveProfile(String profile) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest addActiveProfiles(List<String> profiles) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest setActiveProfiles(List<String> profiles) {
    throw new IllegalStateException();
  }

  public List<String> getActiveProfiles() {
    return Collections.unmodifiableList(request.getActiveProfiles());
  }

  public MavenExecutionRequest addInactiveProfile(String profile) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest addInactiveProfiles(List<String> profiles) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest setInactiveProfiles(List<String> profiles) {
    throw new IllegalStateException();
  }

  public List<String> getInactiveProfiles() {
    return Collections.unmodifiableList(request.getInactiveProfiles());
  }

  public List<Proxy> getProxies() {
    return Collections.unmodifiableList(request.getProxies());
  }

  public MavenExecutionRequest setProxies(List<Proxy> proxies) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest addProxy(Proxy proxy) {
    throw new IllegalStateException();
  }

  public List<Server> getServers() {
    return Collections.unmodifiableList(request.getServers());
  }

  public MavenExecutionRequest setServers(List<Server> servers) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest addServer(Server server) {
    throw new IllegalStateException();
  }

  public List<Mirror> getMirrors() {
    return Collections.unmodifiableList(request.getMirrors());
  }

  public MavenExecutionRequest setMirrors(List<Mirror> mirrors) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest addMirror(Mirror mirror) {
    throw new IllegalStateException();
  }

  public List<String> getPluginGroups() {
    return Collections.unmodifiableList(request.getPluginGroups());
  }

  public MavenExecutionRequest setPluginGroups(List<String> pluginGroups) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest addPluginGroup(String pluginGroup) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest addPluginGroups(List<String> pluginGroups) {
    throw new IllegalStateException();
  }

  public boolean isProjectPresent() {
    return request.isProjectPresent();
  }

  public MavenExecutionRequest setProjectPresent(boolean isProjectPresent) {
    throw new IllegalStateException();
  }

  public File getUserSettingsFile() {
    return request.getUserSettingsFile();
  }

  public MavenExecutionRequest setUserSettingsFile(File userSettingsFile) {
    throw new IllegalStateException();
  }

  public File getGlobalSettingsFile() {
    return request.getGlobalSettingsFile();
  }

  public MavenExecutionRequest setGlobalSettingsFile(File globalSettingsFile) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest addRemoteRepository(ArtifactRepository repository) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest addPluginArtifactRepository(ArtifactRepository repository) {
    throw new IllegalStateException();
  }

  public MavenExecutionRequest setRemoteRepositories(List<ArtifactRepository> repositories) {
    throw new IllegalStateException();
  }

  public List<ArtifactRepository> getRemoteRepositories() {
    return Collections.unmodifiableList(request.getRemoteRepositories());
  }

  public MavenExecutionRequest setPluginArtifactRepositories(List<ArtifactRepository> repositories) {
    throw new IllegalStateException();
  }

  public List<ArtifactRepository> getPluginArtifactRepositories() {
    return Collections.unmodifiableList(request.getPluginArtifactRepositories());
  }

  public MavenExecutionRequest setRepositoryCache(RepositoryCache repositoryCache) {
    throw new IllegalStateException();
  }

  public RepositoryCache getRepositoryCache() {
    return request.getRepositoryCache();
  }

  public WorkspaceReader getWorkspaceReader() {
    return request.getWorkspaceReader();
  }

  public MavenExecutionRequest setWorkspaceReader(WorkspaceReader workspaceReader) {
    throw new IllegalStateException();
  }

  public File getUserToolchainsFile() {
    return request.getUserToolchainsFile();
  }

  public MavenExecutionRequest setUserToolchainsFile(File userToolchainsFile) {
    throw new IllegalStateException();
  }

  public ExecutionListener getExecutionListener() {
    return request.getExecutionListener();
  }

  public MavenExecutionRequest setExecutionListener(ExecutionListener executionListener) {
    throw new IllegalStateException();
  }

  public ProjectBuildingRequest getProjectBuildingRequest() {
    // TODO unmodifiable ProjectBuildingRequest
    return request.getProjectBuildingRequest();
  }

  /* (non-Javadoc)
   * @see org.apache.maven.execution.MavenExecutionRequest#isUseLegacyLocalRepository()
   */
  public boolean isUseLegacyLocalRepository() {
    return request.isUseLegacyLocalRepository();
  }

  /* (non-Javadoc)
   * @see org.apache.maven.execution.MavenExecutionRequest#setUseLegacyLocalRepository(boolean)
   */
  public MavenExecutionRequest setUseLegacyLocalRepository(boolean useLegacyRepository) {
    return request.setUseLegacyLocalRepository(useLegacyRepository);
  }

  @Override
  public String getBuilderId() {
    return request.getBuilderId();
  }

  @Override
  public int getDegreeOfConcurrency() {
    return request.getDegreeOfConcurrency();
  }

  @Override
  public List<String> getExcludedProjects() {
    return Collections.unmodifiableList(request.getExcludedProjects());
  }

  @Override
  public MavenExecutionRequest setBuilderId(String builderId) {
    throw new IllegalStateException();
  }

  @Override
  public void setDegreeOfConcurrency(int degree) {
    throw new IllegalStateException();
  }

  @Override
  public MavenExecutionRequest setExcludedProjects(List<String> excludedProjects) {
    throw new IllegalStateException();
  }

}

Back to the top