View Javadoc
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)}
95       * instead.
96       */
97      void prepare( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
98                    boolean resume, boolean dryRun )
99          throws ReleaseExecutionException, ReleaseFailureException;
100     
101     /**
102      * Prepare a release.
103      * 
104      * @param prepareRequest             all prepare arguments
105      * @throws ReleaseExecutionException if there is a problem performing the release
106      * @throws ReleaseFailureException   if there is a problem performing the release
107      * @since 2.3
108      */
109     void prepare( ReleasePrepareRequest prepareRequest ) throws ReleaseExecutionException, ReleaseFailureException;
110 
111     /**
112      * Prepare a release.
113      *
114      * @param releaseDescriptor the configuration to pass to the preparation steps
115      * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
116      * @param reactorProjects   the reactor projects
117      * @param resume            resume a previous release, if the properties file exists
118      * @param dryRun            do not commit any changes to the file system or SCM
119      * @param listener          the listener
120      * @throws ReleaseExecutionException if there is a problem performing the release
121      * @throws ReleaseFailureException   if there is a problem performing the release
122      */
123     void prepare( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
124                   List<MavenProject> reactorProjects, boolean resume, boolean dryRun, ReleaseManagerListener listener )
125         throws ReleaseExecutionException, ReleaseFailureException;
126 
127     /**
128      * Prepare a release.
129      *
130      * @param releaseDescriptor the configuration to pass to the preparation steps
131      * @param settings          the settings.xml configuration
132      * @param reactorProjects   the reactor projects
133      * @param resume            resume a previous release, if the properties file exists
134      * @param dryRun            do not commit any changes to the file system or SCM
135      * @param listener          the listener
136      * @throws ReleaseExecutionException if there is a problem performing the release
137      * @throws ReleaseFailureException   if there is a problem performing the release
138      *
139      * @deprecated Use {@link ReleaseManager#prepare(ReleaseDescriptor, ReleaseEnvironment, List, boolean, boolean,
140      * ReleaseManagerListener)} instead.
141      */
142     void prepare( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
143                   boolean resume, boolean dryRun, ReleaseManagerListener listener )
144         throws ReleaseExecutionException, ReleaseFailureException;
145 
146     ReleaseResult prepareWithResult( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
147                                      List<MavenProject> reactorProjects, boolean resume, boolean dryRun,
148                                      ReleaseManagerListener listener );
149 
150     /**
151      * @deprecated Use {@link ReleaseManager#prepareWithResult(ReleaseDescriptor, ReleaseEnvironment, List, boolean,
152      * boolean, ReleaseManagerListener)} instead.
153      */
154     ReleaseResult prepareWithResult( ReleaseDescriptor releaseDescriptor, Settings settings,
155                                      List<MavenProject> reactorProjects, boolean resume, boolean dryRun,
156                                      ReleaseManagerListener listener );
157 
158     /**
159      * Perform a release.
160      *
161      * @param releaseDescriptor the configuration to use for release
162      * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
163      * @param reactorProjects   the reactor projects
164      * @throws ReleaseExecutionException if there is a problem performing the release
165      * @throws ReleaseFailureException   if there is a problem performing the release
166      */
167     void perform( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
168                   List<MavenProject> reactorProjects )
169         throws ReleaseExecutionException, ReleaseFailureException;
170 
171     /**
172      * Perform a release.
173      *
174      * @param releaseDescriptor the configuration to use for release
175      * @param settings          the settings.xml configuration
176      * @param reactorProjects   the reactor projects
177      * @throws ReleaseExecutionException if there is a problem performing the release
178      * @throws ReleaseFailureException   if there is a problem performing the release
179      *
180      * @deprecated Use {@link ReleaseManager#perform(ReleaseDescriptor, ReleaseEnvironment, List)} instead
181      */
182     void perform( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects )
183         throws ReleaseExecutionException, ReleaseFailureException;
184 
185     /**
186      * Perform a release.
187      *
188      * @param releaseDescriptor the configuration to use for release
189      * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
190      * @param reactorProjects   the reactor projects
191      * @param listener          the listener
192      * @throws ReleaseExecutionException if there is a problem performing the release
193      * @throws ReleaseFailureException   if there is a problem performing the release
194      */
195     void perform( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
196                   List<MavenProject> reactorProjects, ReleaseManagerListener listener )
197         throws ReleaseExecutionException, ReleaseFailureException;
198 
199     /**
200      * Perform a release.
201      *
202      * @param releaseDescriptor the configuration to use for release
203      * @param settings          the settings.xml configuration
204      * @param reactorProjects   the reactor projects
205      * @param listener          the listener
206      * @throws ReleaseExecutionException if there is a problem performing the release
207      * @throws ReleaseFailureException   if there is a problem performing the release
208      *
209      * @deprecated Use {@link ReleaseManager#perform(ReleaseDescriptor, ReleaseEnvironment, List,
210      * ReleaseManagerListener)} instead.
211      */
212     void perform( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
213                   ReleaseManagerListener listener )
214         throws ReleaseExecutionException, ReleaseFailureException;
215 
216     ReleaseResult performWithResult( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
217                                      List<MavenProject> reactorProjects, ReleaseManagerListener listener );
218 
219     /**
220      * @deprecated Use {@link ReleaseManager#performWithResult(ReleaseDescriptor, ReleaseEnvironment, List,
221      * ReleaseManagerListener)} instead.
222      */
223     ReleaseResult performWithResult( ReleaseDescriptor releaseDescriptor, Settings settings,
224                                      List<MavenProject> reactorProjects, ReleaseManagerListener listener );
225 
226     /**
227      * Perform a release, and optionally cleanup.
228      *
229      * @param releaseDescriptor the configuration to use for release
230      * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
231      * @param reactorProjects   the reactor projects
232      * @param clean             flag to clean the release after perform
233      * @throws ReleaseExecutionException if there is a problem performing the release
234      * @throws ReleaseFailureException   if there is a problem performing the release
235      */
236     void perform( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
237                   List<MavenProject> reactorProjects, boolean clean )
238         throws ReleaseExecutionException, ReleaseFailureException;
239 
240     /**
241      * Perform a release
242      * 
243      * @param performRequest   all perform arguments
244      * @throws ReleaseExecutionException if there is a problem performing the release
245      * @throws ReleaseFailureException   if there is a problem performing the release
246      * @since 2.3
247      */
248     void perform( ReleasePerformRequest performRequest )
249         throws ReleaseExecutionException, ReleaseFailureException;
250 
251     /**
252      * Perform a release, and optionally cleanup.
253      *
254      * @param releaseDescriptor the configuration to use for release
255      * @param settings          the settings.xml configuration
256      * @param reactorProjects   the reactor projects
257      * @param clean             flag to clean the release after perform
258      * @throws ReleaseExecutionException if there is a problem performing the release
259      * @throws ReleaseFailureException   if there is a problem performing the release
260      *
261      * @deprecated Use {@link ReleaseManager#perform(ReleaseDescriptor, ReleaseEnvironment, List, boolean)} instead.
262      */
263     void perform( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
264                   boolean clean )
265         throws ReleaseExecutionException, ReleaseFailureException;
266 
267     /**
268      * Clean a release.
269      *
270      * @param releaseDescriptor the configuration to use for release
271      * @param reactorProjects   the reactor projects
272      */
273     void clean( ReleaseDescriptor releaseDescriptor, ReleaseManagerListener listener,
274                 List<MavenProject> reactorProjects );
275 
276     /**
277      * Clean a release.
278      * 
279      * @param cleanRequest all clean arguments
280      * @since 2.3
281      */
282     void clean( ReleaseCleanRequest cleanRequest );
283 
284     /**
285      * Rollback changes made by the previous release
286      *
287      * @param releaseDescriptor the configuration to use for release
288      * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
289      * @param reactorProjects   the reactor projects
290      * @throws ReleaseExecutionException if there is a problem during release rollback
291      * @throws ReleaseFailureException   if there is a problem during release rollback
292      */
293     void rollback( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
294                    List<MavenProject> reactorProjects )
295         throws ReleaseExecutionException, ReleaseFailureException;
296 
297     /**
298      * Rollback changes made by the previous release
299      *
300      * @param releaseDescriptor the configuration to use for release
301      * @param settings          the settings.xml configuration
302      * @param reactorProjects   the reactor projects
303      * @throws ReleaseExecutionException if there is a problem during release rollback
304      * @throws ReleaseFailureException   if there is a problem during release rollback
305      *
306      * @deprecated Use {@link ReleaseManager#rollback(ReleaseDescriptor, ReleaseEnvironment, List)} instead.
307      */
308     void rollback( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects )
309         throws ReleaseExecutionException, ReleaseFailureException;
310 
311     /**
312      * Rollback changes made by the previous release
313      *
314      * @param releaseDescriptor the configuration to use for release
315      * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
316      * @param reactorProjects   the reactor projects
317      * @param listener          the listener
318      * @throws ReleaseExecutionException if there is a problem during release rollback
319      * @throws ReleaseFailureException   if there is a problem during release rollback
320      */
321     void rollback( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
322                    List<MavenProject> reactorProjects, ReleaseManagerListener listener )
323         throws ReleaseExecutionException, ReleaseFailureException;
324 
325     /**
326      * Rollback changes made by the previous release
327      *
328      * @param releaseDescriptor the configuration to use for release
329      * @param settings          the settings.xml configuration
330      * @param reactorProjects   the reactor projects
331      * @param listener          the listener
332      * @throws ReleaseExecutionException if there is a problem during release rollback
333      * @throws ReleaseFailureException   if there is a problem during release rollback
334      *
335      * @deprecated Use {@link ReleaseManager#rollback(ReleaseDescriptor, ReleaseEnvironment, List,
336      * ReleaseManagerListener)} instead.
337      */
338     void rollback( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
339                    ReleaseManagerListener listener )
340         throws ReleaseExecutionException, ReleaseFailureException;
341 
342     /**
343      * Rollback changes made by the previous release
344      * 
345      * @param rollbackRequest            all rollback arguments
346      * @throws ReleaseExecutionException if there is a problem during release rollback
347      * @throws ReleaseFailureException   if there is a problem during release rollback
348      * @since 2.3
349      */
350     void rollback( ReleaseRollbackRequest rollbackRequest )
351         throws ReleaseExecutionException, ReleaseFailureException;
352 
353     /**
354      * Branch a project
355      *
356      * @param releaseDescriptor the configuration to use for release
357      * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
358      * @param reactorProjects   the reactor projects
359      * @param dryRun            do not commit any changes to the file system or SCM
360      * @throws ReleaseExecutionException if there is a problem during release branch
361      * @throws ReleaseFailureException   if there is a problem during release branch
362      */
363     void branch( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
364                  List<MavenProject> reactorProjects, boolean dryRun )
365         throws ReleaseExecutionException, ReleaseFailureException;
366 
367     /**
368      * Branch a project
369      *
370      * @param releaseDescriptor the configuration to use for release
371      * @param settings          the settings.xml configuration
372      * @param reactorProjects   the reactor projects
373      * @param dryRun            do not commit any changes to the file system or SCM
374      * @throws ReleaseExecutionException if there is a problem during release branch
375      * @throws ReleaseFailureException   if there is a problem during release branch
376      *
377      * @deprecated Use {@link ReleaseManager#branch(ReleaseDescriptor, ReleaseEnvironment, List, boolean)} instead.
378      */
379     void branch( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
380                  boolean dryRun )
381         throws ReleaseExecutionException, ReleaseFailureException;
382 
383     /**
384      * Branch a project
385      *
386      * @param releaseDescriptor the configuration to use for release
387      * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
388      * @param reactorProjects   the reactor projects
389      * @param dryRun            do not commit any changes to the file system or SCM
390      * @param listener          the listener
391      * @throws ReleaseExecutionException if there is a problem during release branch
392      * @throws ReleaseFailureException   if there is a problem during release branch
393      */
394     void branch( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
395                  List<MavenProject> reactorProjects, boolean dryRun, ReleaseManagerListener listener )
396         throws ReleaseExecutionException, ReleaseFailureException;
397 
398     /**
399      * Branch a project
400      *
401      * @param releaseDescriptor the configuration to use for release
402      * @param settings          the settings.xml configuration
403      * @param reactorProjects   the reactor projects
404      * @param dryRun            do not commit any changes to the file system or SCM
405      * @param listener          the listener
406      * @throws ReleaseExecutionException if there is a problem during release branch
407      * @throws ReleaseFailureException   if there is a problem during release branch
408      *
409      * @deprecated Use {@link ReleaseManager#branch(ReleaseDescriptor, ReleaseEnvironment, List, boolean,
410      * ReleaseManagerListener)} instead.
411      */
412     void branch( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects,
413                  boolean dryRun, ReleaseManagerListener listener )
414         throws ReleaseExecutionException, ReleaseFailureException;
415 
416     /**
417      * Branch a project
418      * 
419      * @param branchRequest              all branch arguments
420      * @throws ReleaseExecutionException if there is a problem during release branch
421      * @throws ReleaseFailureException   if there is a problem during release branch
422      * @since 2.3
423      */
424     void branch( ReleaseBranchRequest branchRequest ) throws ReleaseExecutionException, ReleaseFailureException;
425 
426     /**
427      * Update version numbers for a project
428      *
429      * @param releaseDescriptor the configuration to use for release
430      * @param releaseEnvironment settings, maven-home, java-home, etc. to use during release.
431      * @param reactorProjects   the reactor projects
432      * @throws ReleaseExecutionException if there is a problem during update versions
433      * @throws ReleaseFailureException   if there is a problem during update versions
434      */
435     void updateVersions( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
436                          List<MavenProject> reactorProjects )
437         throws ReleaseExecutionException, ReleaseFailureException;
438 
439     /**
440      * Update version numbers for a project
441      * 
442      * @param updateVersionsRequest      all update versions arguments
443      * @throws ReleaseExecutionException if there is a problem during update versions
444      * @throws ReleaseFailureException   if there is a problem during update versions
445      * @since 2.3
446      */
447     void updateVersions( ReleaseUpdateVersionsRequest updateVersionsRequest )
448         throws ReleaseExecutionException, ReleaseFailureException;
449 }