1 package org.apache.maven.shared.release.phase;
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.ReleaseExecutionException;
25 import org.apache.maven.shared.release.ReleaseFailureException;
26 import org.apache.maven.shared.release.ReleaseResult;
27 import org.apache.maven.shared.release.config.ReleaseDescriptor;
28 import org.apache.maven.shared.release.env.ReleaseEnvironment;
29
30 import java.util.List;
31
32 /**
33 * A phase in the release cycle.
34 *
35 * @author <a href="mailto:brett@apache.org">Brett Porter</a>
36 */
37 public interface ReleasePhase
38 {
39 /**
40 * The Plexus role.
41 */
42 String ROLE = ReleasePhase.class.getName();
43
44 /**
45 * Execute the phase.
46 *
47 * @param releaseDescriptor the configuration to use
48 * @param releaseEnvironment the environmental configuration, such as Maven settings, Maven home, etc.
49 * @param reactorProjects the reactor projects
50 * @throws ReleaseExecutionException an exception during the execution of the phase
51 * @throws ReleaseFailureException a failure during the execution of the phase
52 * @return the release result
53 */
54 ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment, List<MavenProject> reactorProjects )
55 throws ReleaseExecutionException, ReleaseFailureException;
56
57 /**
58 * Simulate the phase, but don't make any changes to the project.
59 *
60 * @param releaseDescriptor the configuration to use
61 * @param releaseEnvironment the environmental configuration, such as Maven settings, Maven home, etc.
62 * @param reactorProjects the reactor projects
63 * @throws ReleaseExecutionException an exception during the execution of the phase
64 * @throws ReleaseFailureException a failure during the execution of the phase
65 * @return the release result
66 */
67 ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment, List<MavenProject> reactorProjects )
68 throws ReleaseExecutionException, ReleaseFailureException;
69
70 /**
71 * Execute the phase.
72 *
73 * @param releaseDescriptor the configuration to use
74 * @param settings the settings.xml configuration
75 * @param reactorProjects the reactor projects
76 * @throws ReleaseExecutionException an exception during the execution of the phase
77 * @throws ReleaseFailureException a failure during the execution of the phase
78 * @return the release result
79 *
80 * @deprecated Use {@link ReleasePhase#execute(ReleaseDescriptor, ReleaseEnvironment, List)} instead.
81 */
82 ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects )
83 throws ReleaseExecutionException, ReleaseFailureException;
84
85 /**
86 * Simulate the phase, but don't make any changes to the project.
87 *
88 * @param releaseDescriptor the configuration to use
89 * @param settings the settings.xml configuration
90 * @param reactorProjects the reactor projects
91 * @throws ReleaseExecutionException an exception during the execution of the phase
92 * @throws ReleaseFailureException a failure during the execution of the phase
93 * @return the release result
94 *
95 * @deprecated Use {@link ReleasePhase#simulate(ReleaseDescriptor, ReleaseEnvironment, List)} instead.
96 */
97 ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects )
98 throws ReleaseExecutionException, ReleaseFailureException;
99
100 /**
101 * Clean up after a phase if it leaves any additional files in the checkout.
102 *
103 * @param reactorProjects the reactor projects
104 * @return the release result
105 */
106 ReleaseResult clean( List<MavenProject> reactorProjects );
107 }