1 package org.apache.maven.shared.release.exec; 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.shared.release.ReleaseResult; 23 import org.apache.maven.shared.release.env.ReleaseEnvironment; 24 25 import java.io.File; 26 27 /** 28 * Execute Maven. May be implemented as a forked instance, or embedded. 29 * 30 * @author <a href="mailto:brett@apache.org">Brett Porter</a> 31 */ 32 public interface MavenExecutor 33 { 34 /** 35 * Plexus Role. 36 */ 37 String ROLE = MavenExecutor.class.getName(); 38 39 /** 40 * Execute goals using Maven. 41 * 42 * @param workingDirectory the directory to execute in 43 * @param goals the goals to run (space delimited) 44 * @param releaseEnvironment the environmental settings, maven-home, etc used for this release 45 * @param interactive whether to execute in interactive mode, or the default batch mode 46 * @param additionalArguments additional arguments to pass to the Maven command 47 * @param pomFileName the file name of the POM to execute on 48 * @param result holds all results of the execution 49 * @throws MavenExecutorException if an error occurred executing Maven 50 */ 51 void executeGoals( File workingDirectory, String goals, ReleaseEnvironment releaseEnvironment, 52 boolean interactive, String additionalArguments, String pomFileName, ReleaseResult result ) 53 throws MavenExecutorException; 54 55 /** 56 * Execute goals using Maven. 57 * 58 * @param workingDirectory the directory to execute in 59 * @param goals the goals to run (space delimited) 60 * @param releaseEnvironment the environmental settings, maven-home, etc used for this release 61 * @param interactive whether to execute in interactive mode, or the default batch mode 62 * @param additionalArguments additional arguments to pass to the Maven command 63 * @param result holds all results of the execution 64 * @throws MavenExecutorException if an error occurred executing Maven 65 */ 66 void executeGoals( File workingDirectory, String goals, ReleaseEnvironment releaseEnvironment, 67 boolean interactive, String additionalArguments, ReleaseResult result ) 68 throws MavenExecutorException; 69 70 /** 71 * Execute goals using Maven. 72 * 73 * @param workingDirectory the directory to execute in 74 * @param goals the goals to run (space delimited) 75 * @param interactive whether to execute in interactive mode, or the default batch mode 76 * @param additionalArguments additional arguments to pass to the Maven command 77 * @param pomFileName the file name of the POM to execute on 78 * @param result holds all results of the execution 79 * @throws MavenExecutorException if an error occurred executing Maven 80 * 81 * @deprecated Use {@link MavenExecutor#executeGoals(File, String, ReleaseEnvironment, boolean, String, String, ReleaseResult)} instead 82 */ 83 void executeGoals( File workingDirectory, String goals, boolean interactive, String additionalArguments, 84 String pomFileName, ReleaseResult result ) 85 throws MavenExecutorException; 86 87 /** 88 * Execute goals using Maven. 89 * 90 * @param workingDirectory the directory to execute in 91 * @param goals the goals to run (space delimited) 92 * @param interactive whether to execute in interactive mode, or the default batch mode 93 * @param additionalArguments additional arguments to pass to the Maven command 94 * @param result holds all results of the execution 95 * @throws MavenExecutorException if an error occurred executing Maven 96 * 97 * @deprecated Use {@link MavenExecutor#executeGoals(File, String, ReleaseEnvironment, boolean, String, ReleaseResult)} instead 98 */ 99 void executeGoals( File workingDirectory, String goals, boolean interactive, String additionalArguments, 100 ReleaseResult result ) 101 throws MavenExecutorException; 102 }