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, 55 List<MavenProject> reactorProjects ) 56 throws ReleaseExecutionException, ReleaseFailureException; 57 58 /** 59 * Simulate the phase, but don't make any changes to the project. 60 * 61 * @param releaseDescriptor the configuration to use 62 * @param releaseEnvironment the environmental configuration, such as Maven settings, Maven home, etc. 63 * @param reactorProjects the reactor projects 64 * @throws ReleaseExecutionException an exception during the execution of the phase 65 * @throws ReleaseFailureException a failure during the execution of the phase 66 * @return the release result 67 */ 68 ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment, 69 List<MavenProject> reactorProjects ) 70 throws ReleaseExecutionException, ReleaseFailureException; 71 72 /** 73 * Execute the phase. 74 * 75 * @param releaseDescriptor the configuration to use 76 * @param settings the settings.xml configuration 77 * @param reactorProjects the reactor projects 78 * @throws ReleaseExecutionException an exception during the execution of the phase 79 * @throws ReleaseFailureException a failure during the execution of the phase 80 * @return the release result 81 * 82 * @deprecated Use {@link ReleasePhase#execute(ReleaseDescriptor, ReleaseEnvironment, List)} instead. 83 */ 84 ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects ) 85 throws ReleaseExecutionException, ReleaseFailureException; 86 87 /** 88 * Simulate the phase, but don't make any changes to the project. 89 * 90 * @param releaseDescriptor the configuration to use 91 * @param settings the settings.xml configuration 92 * @param reactorProjects the reactor projects 93 * @throws ReleaseExecutionException an exception during the execution of the phase 94 * @throws ReleaseFailureException a failure during the execution of the phase 95 * @return the release result 96 * 97 * @deprecated Use {@link ReleasePhase#simulate(ReleaseDescriptor, ReleaseEnvironment, List)} instead. 98 */ 99 ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List<MavenProject> reactorProjects ) 100 throws ReleaseExecutionException, ReleaseFailureException; 101 102 /** 103 * Clean up after a phase if it leaves any additional files in the checkout. 104 * 105 * @param reactorProjects the reactor projects 106 * @return the release result 107 */ 108 ReleaseResult clean( List<MavenProject> reactorProjects ); 109 }