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