1 package org.apache.maven.settings;
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.HashMap;
24 import java.util.Map;
25
26
27
28
29
30
31 public class RuntimeInfo
32 {
33 private File file;
34
35
36 private Boolean pluginUpdateForced;
37
38
39 private Boolean applyToAllPluginUpdates;
40
41
42
43
44
45
46 private Map activeProfileToSourceLevel = new HashMap();
47
48 private String localRepositorySourceLevel = TrackableBase.USER_LEVEL;
49
50 private Map pluginGroupIdSourceLevels = new HashMap();
51
52 private final Settings settings;
53
54
55
56
57 public RuntimeInfo( Settings settings )
58 {
59 this.settings = settings;
60 }
61
62
63
64
65 public void setFile( File file )
66 {
67 this.file = file;
68 }
69
70
71
72
73 public File getFile()
74 {
75 return file;
76 }
77
78
79
80
81 public void setPluginUpdateOverride( Boolean pluginUpdateForced )
82 {
83 this.pluginUpdateForced = pluginUpdateForced;
84 }
85
86
87
88
89 public Boolean getPluginUpdateOverride()
90 {
91 return pluginUpdateForced;
92 }
93
94
95
96
97 public Boolean getApplyToAllPluginUpdates()
98 {
99 return applyToAllPluginUpdates;
100 }
101
102
103
104
105 public void setApplyToAllPluginUpdates( Boolean applyToAll )
106 {
107 this.applyToAllPluginUpdates = applyToAll;
108 }
109
110
111
112
113
114 public void setActiveProfileSourceLevel( String activeProfile, String sourceLevel )
115 {
116 activeProfileToSourceLevel.put( activeProfile, sourceLevel );
117 }
118
119
120
121
122
123 public String getSourceLevelForActiveProfile( String activeProfile )
124 {
125 String sourceLevel = (String) activeProfileToSourceLevel.get( activeProfile );
126
127 if ( sourceLevel != null )
128 {
129 return sourceLevel;
130 }
131 else
132 {
133 return settings.getSourceLevel();
134 }
135 }
136
137
138
139
140
141 public void setPluginGroupIdSourceLevel( String pluginGroupId, String sourceLevel )
142 {
143 pluginGroupIdSourceLevels.put( pluginGroupId, sourceLevel );
144 }
145
146
147
148
149
150 public String getSourceLevelForPluginGroupId( String pluginGroupId )
151 {
152 String sourceLevel = (String) pluginGroupIdSourceLevels.get( pluginGroupId );
153
154 if ( sourceLevel != null )
155 {
156 return sourceLevel;
157 }
158 else
159 {
160 return settings.getSourceLevel();
161 }
162 }
163
164
165
166
167 public void setLocalRepositorySourceLevel( String localRepoSourceLevel )
168 {
169 this.localRepositorySourceLevel = localRepoSourceLevel;
170 }
171
172
173
174
175 public String getLocalRepositorySourceLevel()
176 {
177 return localRepositorySourceLevel;
178 }
179 }