1 package org.apache.maven.shared.release;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import org.apache.maven.project.MavenProject;
23 import org.apache.maven.settings.Settings;
24 import org.apache.maven.shared.release.config.ReleaseDescriptor;
25 import org.apache.maven.shared.release.env.ReleaseEnvironment;
26
27 import java.util.List;
28
29 /**
30 * Release management classes.
31 *
32 * @author <a href="mailto:brett@apache.org">Brett Porter</a>
33 */
34 public interface ReleaseManager
35 {
36 /**
37 * The Plexus role.
38 */
39 String ROLE = ReleaseManager.class.getName();
40
41 /**
42 * Prepare a release.
43 *
44 * @param releaseDescriptor the configuration to pass to the preparation steps
45 * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
46 * @param reactorProjects the reactor projects
47 * @throws ReleaseExecutionException if there is a problem performing the release
48 * @throws ReleaseFailureException if there is a problem performing the release
49 */
50 void prepare( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
51 List<MavenProject> reactorProjects )
52 throws ReleaseExecutionException, ReleaseFailureException;
53
54 /**
55 * Prepare a release.
56 *
57 * @param releaseDescriptor the configuration to pass to the preparation steps
58 * @param settings the settings.xml configuration
59 * @param reactorProjects the reactor projects
60 * @throws ReleaseExecutionException if there is a problem performing the release
61 * @throws ReleaseFailureException if there is a problem performing the release
62 *
63 * @deprecated Use {@link ReleaseManager#prepare(ReleaseDescriptor, ReleaseEnvironment, List)} instead.
64 */
65 void prepare( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects )
66 throws ReleaseExecutionException, ReleaseFailureException;
67
68 /**
69 * Prepare a release.
70 *
71 * @param releaseDescriptor the configuration to pass to the preparation steps
72 * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
73 * @param reactorProjects the reactor projects
74 * @param resume resume a previous release, if the properties file exists
75 * @param dryRun do not commit any changes to the file system or SCM
76 * @throws ReleaseExecutionException if there is a problem performing the release
77 * @throws ReleaseFailureException if there is a problem performing the release
78 */
79 void prepare( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
80 List<MavenProject> reactorProjects, boolean resume, boolean dryRun )
81 throws ReleaseExecutionException, ReleaseFailureException;
82
83 /**
84 * Prepare a release.
85 *
86 * @param releaseDescriptor the configuration to pass to the preparation steps
87 * @param settings the settings.xml configuration
88 * @param reactorProjects the reactor projects
89 * @param resume resume a previous release, if the properties file exists
90 * @param dryRun do not commit any changes to the file system or SCM
91 * @throws ReleaseExecutionException if there is a problem performing the release
92 * @throws ReleaseFailureException if there is a problem performing the release
93 *
94 * @deprecated Use {@link ReleaseManager#prepare(ReleaseDescriptor, ReleaseEnvironment, List, boolean, boolean)} instead.
95 */
96 void prepare( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
97 boolean resume, boolean dryRun )
98 throws ReleaseExecutionException, ReleaseFailureException;
99
100 /**
101 * Prepare a release.
102 *
103 * @param prepareRequest all prepare arguments
104 * @throws ReleaseExecutionException if there is a problem performing the release
105 * @throws ReleaseFailureException if there is a problem performing the release
106 * @since 2.3
107 */
108 void prepare( ReleasePrepareRequest prepareRequest ) throws ReleaseExecutionException, ReleaseFailureException;
109
110 /**
111 * Prepare a release.
112 *
113 * @param releaseDescriptor the configuration to pass to the preparation steps
114 * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
115 * @param reactorProjects the reactor projects
116 * @param resume resume a previous release, if the properties file exists
117 * @param dryRun do not commit any changes to the file system or SCM
118 * @param listener the listener
119 * @throws ReleaseExecutionException if there is a problem performing the release
120 * @throws ReleaseFailureException if there is a problem performing the release
121 */
122 void prepare( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
123 List<MavenProject> reactorProjects, boolean resume, boolean dryRun, ReleaseManagerListener listener )
124 throws ReleaseExecutionException, ReleaseFailureException;
125
126 /**
127 * Prepare a release.
128 *
129 * @param releaseDescriptor the configuration to pass to the preparation steps
130 * @param settings the settings.xml configuration
131 * @param reactorProjects the reactor projects
132 * @param resume resume a previous release, if the properties file exists
133 * @param dryRun do not commit any changes to the file system or SCM
134 * @param listener the listener
135 * @throws ReleaseExecutionException if there is a problem performing the release
136 * @throws ReleaseFailureException if there is a problem performing the release
137 *
138 * @deprecated Use {@link ReleaseManager#prepare(ReleaseDescriptor, ReleaseEnvironment, List, boolean, boolean, ReleaseManagerListener)} instead.
139 */
140 void prepare( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
141 boolean resume, boolean dryRun, ReleaseManagerListener listener )
142 throws ReleaseExecutionException, ReleaseFailureException;
143
144 ReleaseResult prepareWithResult( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
145 List<MavenProject> reactorProjects, boolean resume, boolean dryRun,
146 ReleaseManagerListener listener );
147
148 /**
149 * @deprecated Use {@link ReleaseManager#prepareWithResult(ReleaseDescriptor, ReleaseEnvironment, List, boolean, boolean, ReleaseManagerListener)} instead.
150 */
151 ReleaseResult prepareWithResult( ReleaseDescriptor releaseDescriptor, Settings settings,
152 List<MavenProject> reactorProjects, boolean resume, boolean dryRun,
153 ReleaseManagerListener listener );
154
155 /**
156 * Perform a release.
157 *
158 * @param releaseDescriptor the configuration to use for release
159 * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
160 * @param reactorProjects the reactor projects
161 * @throws ReleaseExecutionException if there is a problem performing the release
162 * @throws ReleaseFailureException if there is a problem performing the release
163 */
164 void perform( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
165 List<MavenProject> reactorProjects )
166 throws ReleaseExecutionException, ReleaseFailureException;
167
168 /**
169 * Perform a release.
170 *
171 * @param releaseDescriptor the configuration to use for release
172 * @param settings the settings.xml configuration
173 * @param reactorProjects the reactor projects
174 * @throws ReleaseExecutionException if there is a problem performing the release
175 * @throws ReleaseFailureException if there is a problem performing the release
176 *
177 * @deprecated Use {@link ReleaseManager#perform(ReleaseDescriptor, ReleaseEnvironment, List)} instead
178 */
179 void perform( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects )
180 throws ReleaseExecutionException, ReleaseFailureException;
181
182 /**
183 * Perform a release.
184 *
185 * @param releaseDescriptor the configuration to use for release
186 * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
187 * @param reactorProjects the reactor projects
188 * @param listener the listener
189 * @throws ReleaseExecutionException if there is a problem performing the release
190 * @throws ReleaseFailureException if there is a problem performing the release
191 */
192 void perform( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
193 List<MavenProject> reactorProjects, ReleaseManagerListener listener )
194 throws ReleaseExecutionException, ReleaseFailureException;
195
196 /**
197 * Perform a release.
198 *
199 * @param releaseDescriptor the configuration to use for release
200 * @param settings the settings.xml configuration
201 * @param reactorProjects the reactor projects
202 * @param listener the listener
203 * @throws ReleaseExecutionException if there is a problem performing the release
204 * @throws ReleaseFailureException if there is a problem performing the release
205 *
206 * @deprecated Use {@link ReleaseManager#perform(ReleaseDescriptor, ReleaseEnvironment, List, ReleaseManagerListener)} instead.
207 */
208 void perform( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
209 ReleaseManagerListener listener )
210 throws ReleaseExecutionException, ReleaseFailureException;
211
212 ReleaseResult performWithResult( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
213 List<MavenProject> reactorProjects, ReleaseManagerListener listener );
214
215 /**
216 * @deprecated Use {@link ReleaseManager#performWithResult(ReleaseDescriptor, ReleaseEnvironment, List, ReleaseManagerListener)} instead.
217 */
218 ReleaseResult performWithResult( ReleaseDescriptor releaseDescriptor, Settings settings,
219 List<MavenProject> reactorProjects, ReleaseManagerListener listener );
220
221 /**
222 * Perform a release, and optionally cleanup.
223 *
224 * @param releaseDescriptor the configuration to use for release
225 * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
226 * @param reactorProjects the reactor projects
227 * @param clean flag to clean the release after perform
228 * @throws ReleaseExecutionException if there is a problem performing the release
229 * @throws ReleaseFailureException if there is a problem performing the release
230 */
231 void perform( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
232 List<MavenProject> reactorProjects, boolean clean )
233 throws ReleaseExecutionException, ReleaseFailureException;
234
235 /**
236 * Perform a release
237 *
238 * @param performRequest all perform arguments
239 * @throws ReleaseExecutionException if there is a problem performing the release
240 * @throws ReleaseFailureException if there is a problem performing the release
241 * @since 2.3
242 */
243 void perform( ReleasePerformRequest performRequest )
244 throws ReleaseExecutionException, ReleaseFailureException;
245
246 /**
247 * Perform a release, and optionally cleanup.
248 *
249 * @param releaseDescriptor the configuration to use for release
250 * @param settings the settings.xml configuration
251 * @param reactorProjects the reactor projects
252 * @param clean flag to clean the release after perform
253 * @throws ReleaseExecutionException if there is a problem performing the release
254 * @throws ReleaseFailureException if there is a problem performing the release
255 *
256 * @deprecated Use {@link ReleaseManager#perform(ReleaseDescriptor, ReleaseEnvironment, List, boolean)} instead.
257 */
258 void perform( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
259 boolean clean )
260 throws ReleaseExecutionException, ReleaseFailureException;
261
262 /**
263 * Clean a release.
264 *
265 * @param releaseDescriptor the configuration to use for release
266 * @param reactorProjects the reactor projects
267 */
268 void clean( ReleaseDescriptor releaseDescriptor, ReleaseManagerListener listener, List<MavenProject> reactorProjects );
269
270 /**
271 * Clean a release.
272 *
273 * @param cleanRequest all clean arguments
274 * @since 2.3
275 */
276 void clean( ReleaseCleanRequest cleanRequest );
277
278 /**
279 * Rollback changes made by the previous release
280 *
281 * @param releaseDescriptor the configuration to use for release
282 * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
283 * @param reactorProjects the reactor projects
284 * @throws ReleaseExecutionException if there is a problem during release rollback
285 * @throws ReleaseFailureException if there is a problem during release rollback
286 */
287 void rollback( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
288 List<MavenProject> reactorProjects )
289 throws ReleaseExecutionException, ReleaseFailureException;
290
291 /**
292 * Rollback changes made by the previous release
293 *
294 * @param releaseDescriptor the configuration to use for release
295 * @param settings the settings.xml configuration
296 * @param reactorProjects the reactor projects
297 * @throws ReleaseExecutionException if there is a problem during release rollback
298 * @throws ReleaseFailureException if there is a problem during release rollback
299 *
300 * @deprecated Use {@link ReleaseManager#rollback(ReleaseDescriptor, ReleaseEnvironment, List)} instead.
301 */
302 void rollback( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects )
303 throws ReleaseExecutionException, ReleaseFailureException;
304
305 /**
306 * Rollback changes made by the previous release
307 *
308 * @param releaseDescriptor the configuration to use for release
309 * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
310 * @param reactorProjects the reactor projects
311 * @param listener the listener
312 * @throws ReleaseExecutionException if there is a problem during release rollback
313 * @throws ReleaseFailureException if there is a problem during release rollback
314 */
315 void rollback( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
316 List<MavenProject> reactorProjects, ReleaseManagerListener listener )
317 throws ReleaseExecutionException, ReleaseFailureException;
318
319 /**
320 * Rollback changes made by the previous release
321 *
322 * @param releaseDescriptor the configuration to use for release
323 * @param settings the settings.xml configuration
324 * @param reactorProjects the reactor projects
325 * @param listener the listener
326 * @throws ReleaseExecutionException if there is a problem during release rollback
327 * @throws ReleaseFailureException if there is a problem during release rollback
328 *
329 * @deprecated Use {@link ReleaseManager#rollback(ReleaseDescriptor, ReleaseEnvironment, List, ReleaseManagerListener)} instead.
330 */
331 void rollback( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
332 ReleaseManagerListener listener )
333 throws ReleaseExecutionException, ReleaseFailureException;
334
335 /**
336 * Rollback changes made by the previous release
337 *
338 * @param rollbackRequest all rollback arguments
339 * @throws ReleaseExecutionException if there is a problem during release rollback
340 * @throws ReleaseFailureException if there is a problem during release rollback
341 * @since 2.3
342 */
343 void rollback( ReleaseRollbackRequest rollbackRequest )
344 throws ReleaseExecutionException, ReleaseFailureException;
345
346 /**
347 * Branch a project
348 *
349 * @param releaseDescriptor the configuration to use for release
350 * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
351 * @param reactorProjects the reactor projects
352 * @param dryRun do not commit any changes to the file system or SCM
353 * @throws ReleaseExecutionException if there is a problem during release branch
354 * @throws ReleaseFailureException if there is a problem during release branch
355 */
356 void branch( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
357 List<MavenProject> reactorProjects, boolean dryRun )
358 throws ReleaseExecutionException, ReleaseFailureException;
359
360 /**
361 * Branch a project
362 *
363 * @param releaseDescriptor the configuration to use for release
364 * @param settings the settings.xml configuration
365 * @param reactorProjects the reactor projects
366 * @param dryRun do not commit any changes to the file system or SCM
367 * @throws ReleaseExecutionException if there is a problem during release branch
368 * @throws ReleaseFailureException if there is a problem during release branch
369 *
370 * @deprecated Use {@link ReleaseManager#branch(ReleaseDescriptor, ReleaseEnvironment, List, boolean)} instead.
371 */
372 void branch( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
373 boolean dryRun )
374 throws ReleaseExecutionException, ReleaseFailureException;
375
376 /**
377 * Branch a project
378 *
379 * @param releaseDescriptor the configuration to use for release
380 * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
381 * @param reactorProjects the reactor projects
382 * @param dryRun do not commit any changes to the file system or SCM
383 * @param listener the listener
384 * @throws ReleaseExecutionException if there is a problem during release branch
385 * @throws ReleaseFailureException if there is a problem during release branch
386 */
387 void branch( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
388 List<MavenProject> reactorProjects, boolean dryRun, ReleaseManagerListener listener )
389 throws ReleaseExecutionException, ReleaseFailureException;
390
391 /**
392 * Branch a project
393 *
394 * @param releaseDescriptor the configuration to use for release
395 * @param settings the settings.xml configuration
396 * @param reactorProjects the reactor projects
397 * @param dryRun do not commit any changes to the file system or SCM
398 * @param listener the listener
399 * @throws ReleaseExecutionException if there is a problem during release branch
400 * @throws ReleaseFailureException if there is a problem during release branch
401 *
402 * @deprecated Use {@link ReleaseManager#branch(ReleaseDescriptor, ReleaseEnvironment, List, boolean, ReleaseManagerListener)} instead.
403 */
404 void branch( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
405 boolean dryRun, ReleaseManagerListener listener )
406 throws ReleaseExecutionException, ReleaseFailureException;
407
408 /**
409 * Branch a project
410 *
411 * @param branchRequest all branch arguments
412 * @throws ReleaseExecutionException if there is a problem during release branch
413 * @throws ReleaseFailureException if there is a problem during release branch
414 * @since 2.3
415 */
416 void branch( ReleaseBranchRequest branchRequest ) throws ReleaseExecutionException, ReleaseFailureException;
417
418 /**
419 * Update version numbers for a project
420 *
421 * @param releaseDescriptor the configuration to use for release
422 * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
423 * @param reactorProjects the reactor projects
424 * @throws ReleaseExecutionException if there is a problem during update versions
425 * @throws ReleaseFailureException if there is a problem during update versions
426 */
427 void updateVersions( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
428 List<MavenProject> reactorProjects )
429 throws ReleaseExecutionException, ReleaseFailureException;
430
431 /**
432 * Update version numbers for a project
433 *
434 * @param updateVersionsRequest all update versions arguments
435 * @throws ReleaseExecutionException if there is a problem during update versions
436 * @throws ReleaseFailureException if there is a problem during update versions
437 * @since 2.3
438 */
439 void updateVersions( ReleaseUpdateVersionsRequest updateVersionsRequest )
440 throws ReleaseExecutionException, ReleaseFailureException;
441 }