View Javadoc

1   package org.apache.maven.continuum.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.continuum.model.repository.LocalRepository;
23  import org.apache.maven.continuum.model.project.Project;
24  import org.apache.maven.continuum.model.system.Profile;
25  
26  import java.io.File;
27  import java.util.Map;
28  import java.util.Properties;
29  
30  /**
31   * The Continuum Release Manager is responsible for performing releases based on a release descriptor
32   * that has been received by the Maven Release Plugin.
33   *
34   * @author Jason van Zyl
35   * @version $Id: ContinuumReleaseManager.java 751433 2009-03-08 14:41:33Z ctan $
36   */
37  public interface ContinuumReleaseManager
38  {
39      String ROLE = ContinuumReleaseManager.class.getName();
40  
41      /**
42       * Prepare a project for release
43       *
44       * @param project
45       * @param releaseProperties
46       * @param releaseVersions
47       * @param developmentVersions
48       * @param listener
49       * @param workingDirectory
50       * @return
51       * @throws ContinuumReleaseException
52       */
53      String prepare( Project project, Properties releaseProperties, Map<String, String> releaseVersions,
54                      Map<String, String> developmentVersions, ContinuumReleaseManagerListener listener,
55                      String workingDirectory )
56          throws ContinuumReleaseException;
57  
58      /**
59       * Prepare a project for release
60       *
61       * @param project
62       * @param releaseProperties
63       * @param releaseVersions
64       * @param developmentVersions
65       * @param listener
66       * @param workingDirectory
67       * @param environments
68       * @param executable
69       * @return
70       * @throws ContinuumReleaseException
71       */
72      String prepare( Project project, Properties releaseProperties, Map<String, String> releaseVersions,
73                      Map<String, String> developmentVersions, ContinuumReleaseManagerListener listener,
74                      String workingDirectory, Map<String, String> environments, String executable )
75          throws ContinuumReleaseException;
76  
77      /**
78       * Perform a release based on a given releaseId
79       *
80       * @param releaseId
81       * @param buildDirectory
82       * @param goals
83       * @param useReleaseProfile
84       * @throws ContinuumReleaseException
85       */
86      void perform( String releaseId, File buildDirectory, String goals, String arguments, boolean useReleaseProfile,
87                    ContinuumReleaseManagerListener listener )
88          throws ContinuumReleaseException;
89  
90      /**
91       * Perform a release based on a release descriptor received by the Maven Release Plugin.
92       *
93       * @param releaseId
94       * @param workingDirectory
95       * @param buildDirectory
96       * @param goals
97       * @param useReleaseProfile
98       * @param listener
99       * @throws ContinuumReleaseException
100      */
101     void perform( String releaseId, String workingDirectory, File buildDirectory, String goals, String arguments,
102                   boolean useReleaseProfile, ContinuumReleaseManagerListener listener )
103         throws ContinuumReleaseException;
104 
105     /**
106      * Rollback changes made by a previous release.
107      *
108      * @param releaseId
109      * @param workingDirectory
110      * @param listener
111      * @throws ContinuumReleaseException
112      */
113     void rollback( String releaseId, String workingDirectory, ContinuumReleaseManagerListener listener )
114         throws ContinuumReleaseException;
115 
116     Map getPreparedReleases();
117 
118     Map getReleaseResults();
119 
120     Map getListeners();
121 
122     void perform( String releaseId, File buildDirectory, String goals, String arguments, boolean useReleaseProfile,
123                   ContinuumReleaseManagerListener listener, LocalRepository repository )
124         throws ContinuumReleaseException;
125 
126     /**
127      * Clean up the tagname to respect the scm provider policy.
128      *
129      * @param scmUrl  The scm url
130      * @param tagName The tag name
131      * @return The cleaned tag name
132      */
133     String sanitizeTagName( String scmUrl, String tagName )
134         throws Exception;
135 }