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 org.apache.maven.artifact.repository.ArtifactRepository; |
23 | |
import org.apache.maven.monitor.event.EventDispatcher; |
24 | |
import org.apache.maven.monitor.event.EventMonitor; |
25 | |
import org.apache.maven.profiles.ProfileManager; |
26 | |
import org.apache.maven.project.DefaultProjectBuilderConfiguration; |
27 | |
import org.apache.maven.project.ProjectBuilderConfiguration; |
28 | |
import org.apache.maven.settings.Settings; |
29 | |
|
30 | |
import java.util.Date; |
31 | |
import java.util.List; |
32 | |
import java.util.Properties; |
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
public class DefaultMavenExecutionRequest |
39 | |
implements MavenExecutionRequest |
40 | |
{ |
41 | |
|
42 | |
|
43 | |
|
44 | |
private final ArtifactRepository localRepository; |
45 | |
|
46 | |
private final List goals; |
47 | |
|
48 | |
protected MavenSession session; |
49 | |
|
50 | |
private final EventDispatcher eventDispatcher; |
51 | |
|
52 | |
private final Settings settings; |
53 | |
|
54 | |
private final String baseDirectory; |
55 | |
|
56 | 0 | private boolean recursive = true; |
57 | |
|
58 | |
private boolean reactorActive; |
59 | |
|
60 | |
private String pomFilename; |
61 | |
|
62 | |
private String failureBehavior; |
63 | |
|
64 | |
private final ProfileManager globalProfileManager; |
65 | |
|
66 | |
private final Properties executionProperties; |
67 | |
|
68 | |
private final Properties userProperties; |
69 | |
|
70 | |
private final Date startTime; |
71 | |
|
72 | |
private final boolean showErrors; |
73 | |
|
74 | |
private String makeBehavior; |
75 | |
|
76 | |
private String resumeFrom; |
77 | |
|
78 | |
private List selectedProjects; |
79 | |
|
80 | |
public DefaultMavenExecutionRequest( ArtifactRepository localRepository, Settings settings, |
81 | |
EventDispatcher eventDispatcher, List goals, String baseDirectory, |
82 | |
ProfileManager globalProfileManager, Properties executionProperties, |
83 | |
Properties userProperties, |
84 | |
boolean showErrors ) |
85 | 0 | { |
86 | 0 | this.localRepository = localRepository; |
87 | |
|
88 | 0 | this.settings = settings; |
89 | |
|
90 | 0 | this.goals = goals; |
91 | |
|
92 | 0 | this.eventDispatcher = eventDispatcher; |
93 | |
|
94 | 0 | this.baseDirectory = baseDirectory; |
95 | |
|
96 | 0 | this.globalProfileManager = globalProfileManager; |
97 | |
|
98 | 0 | this.executionProperties = executionProperties; |
99 | |
|
100 | 0 | this.userProperties = userProperties; |
101 | |
|
102 | 0 | startTime = new Date(); |
103 | |
|
104 | 0 | this.showErrors = showErrors; |
105 | 0 | } |
106 | |
|
107 | |
public Settings getSettings() |
108 | |
{ |
109 | 0 | return settings; |
110 | |
} |
111 | |
|
112 | |
public String getBaseDirectory() |
113 | |
{ |
114 | 0 | return baseDirectory; |
115 | |
} |
116 | |
|
117 | |
public boolean isRecursive() |
118 | |
{ |
119 | 0 | return recursive; |
120 | |
} |
121 | |
|
122 | |
public void setRecursive( boolean recursive ) |
123 | |
{ |
124 | 0 | this.recursive = false; |
125 | 0 | } |
126 | |
|
127 | |
public ArtifactRepository getLocalRepository() |
128 | |
{ |
129 | 0 | return localRepository; |
130 | |
} |
131 | |
|
132 | |
public List getGoals() |
133 | |
{ |
134 | 0 | return goals; |
135 | |
} |
136 | |
|
137 | |
public Properties getExecutionProperties() |
138 | |
{ |
139 | 0 | return executionProperties; |
140 | |
} |
141 | |
|
142 | |
|
143 | |
|
144 | |
|
145 | |
|
146 | |
public MavenSession getSession() |
147 | |
{ |
148 | 0 | return session; |
149 | |
} |
150 | |
|
151 | |
public void setSession( MavenSession session ) |
152 | |
{ |
153 | 0 | session = session; |
154 | 0 | } |
155 | |
|
156 | |
public void addEventMonitor( EventMonitor monitor ) |
157 | |
{ |
158 | 0 | eventDispatcher.addEventMonitor( monitor ); |
159 | 0 | } |
160 | |
|
161 | |
public EventDispatcher getEventDispatcher() |
162 | |
{ |
163 | 0 | return eventDispatcher; |
164 | |
} |
165 | |
|
166 | |
public void setReactorActive( boolean reactorActive ) |
167 | |
{ |
168 | 0 | this.reactorActive = reactorActive; |
169 | 0 | } |
170 | |
|
171 | |
public boolean isReactorActive() |
172 | |
{ |
173 | 0 | return reactorActive; |
174 | |
} |
175 | |
|
176 | |
public void setPomFile( String pomFilename ) |
177 | |
{ |
178 | 0 | this.pomFilename = pomFilename; |
179 | 0 | } |
180 | |
|
181 | |
public String getPomFile() |
182 | |
{ |
183 | 0 | return pomFilename; |
184 | |
} |
185 | |
|
186 | |
public void setFailureBehavior( String failureBehavior ) |
187 | |
{ |
188 | 0 | this.failureBehavior = failureBehavior; |
189 | 0 | } |
190 | |
|
191 | |
public String getFailureBehavior() |
192 | |
{ |
193 | 0 | return failureBehavior; |
194 | |
} |
195 | |
|
196 | |
public ProfileManager getGlobalProfileManager() |
197 | |
{ |
198 | 0 | return globalProfileManager; |
199 | |
} |
200 | |
|
201 | |
public Date getStartTime() |
202 | |
{ |
203 | 0 | return startTime; |
204 | |
} |
205 | |
|
206 | |
public boolean isShowErrors() |
207 | |
{ |
208 | 0 | return showErrors; |
209 | |
} |
210 | |
|
211 | |
public Properties getUserProperties() |
212 | |
{ |
213 | 0 | return userProperties; |
214 | |
} |
215 | |
|
216 | |
public ProjectBuilderConfiguration getProjectBuilderConfiguration() |
217 | |
{ |
218 | 0 | ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration(); |
219 | 0 | config.setLocalRepository( getLocalRepository() ) |
220 | |
.setGlobalProfileManager( getGlobalProfileManager() ) |
221 | |
.setExecutionProperties( getExecutionProperties() ) |
222 | |
.setUserProperties( getUserProperties() ) |
223 | |
.setBuildStartTime( startTime ); |
224 | |
|
225 | 0 | return config; |
226 | |
} |
227 | |
|
228 | |
public String getMakeBehavior() |
229 | |
{ |
230 | 0 | return makeBehavior; |
231 | |
} |
232 | |
|
233 | |
public void setMakeBehavior( String makeBehavior ) |
234 | |
{ |
235 | 0 | this.makeBehavior = makeBehavior; |
236 | 0 | } |
237 | |
|
238 | |
public String getResumeFrom() |
239 | |
{ |
240 | 0 | return resumeFrom; |
241 | |
} |
242 | |
|
243 | |
public void setResumeFrom( String resumeFrom ) |
244 | |
{ |
245 | 0 | this.resumeFrom = resumeFrom; |
246 | 0 | } |
247 | |
|
248 | |
public List getSelectedProjects() |
249 | |
{ |
250 | 0 | return selectedProjects; |
251 | |
} |
252 | |
|
253 | |
public void setSelectedProjects( List selectedProjects ) |
254 | |
{ |
255 | 0 | this.selectedProjects = selectedProjects; |
256 | 0 | } |
257 | |
|
258 | |
} |