1 package org.apache.maven.execution;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23 import java.util.ArrayList;
24 import java.util.List;
25
26 import org.apache.maven.settings.Mirror;
27 import org.apache.maven.settings.Profile;
28 import org.apache.maven.settings.Proxy;
29 import org.apache.maven.settings.RuntimeInfo;
30 import org.apache.maven.settings.Server;
31 import org.apache.maven.settings.Settings;
32
33
34
35
36
37
38
39
40
41 class SettingsAdapter
42 extends Settings
43 {
44
45 private MavenExecutionRequest request;
46
47 private RuntimeInfo runtimeInfo;
48
49 public SettingsAdapter( MavenExecutionRequest request )
50 {
51 this.request = request;
52
53
54
55
56
57
58 File userSettings = request.getUserSettingsFile();
59 this.runtimeInfo = new RuntimeInfo( ( userSettings != null && userSettings.isFile() ) ? userSettings : null );
60 }
61
62 @Override
63 public String getLocalRepository()
64 {
65 if ( request.getLocalRepositoryPath() != null )
66 {
67 return request.getLocalRepositoryPath().getAbsolutePath();
68 }
69
70 return null;
71 }
72
73 @Override
74 public boolean isInteractiveMode()
75 {
76 return request.isInteractiveMode();
77 }
78
79 @Override
80 public boolean isOffline()
81 {
82 return request.isOffline();
83 }
84
85 @Override
86 public List<Proxy> getProxies()
87 {
88 return request.getProxies();
89 }
90
91 @Override
92 public List<Server> getServers()
93 {
94 return request.getServers();
95 }
96
97 @Override
98 public List<Mirror> getMirrors()
99 {
100 return request.getMirrors();
101 }
102
103 @Override
104 public List<Profile> getProfiles()
105 {
106 return new ArrayList<Profile>();
107 }
108
109 @Override
110 public List<String> getActiveProfiles()
111 {
112 return request.getActiveProfiles();
113 }
114
115 @Override
116 public List<String> getPluginGroups()
117 {
118 return request.getPluginGroups();
119 }
120
121 @Override
122 public RuntimeInfo getRuntimeInfo()
123 {
124 return runtimeInfo;
125 }
126
127 }