001package org.apache.maven.lifecycle.internal;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *  http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import org.apache.maven.execution.MavenSession;
023import org.apache.maven.lifecycle.LifecycleNotFoundException;
024import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException;
025import org.apache.maven.lifecycle.MavenExecutionPlan;
026import org.apache.maven.plugin.InvalidPluginDescriptorException;
027import org.apache.maven.plugin.MojoExecution;
028import org.apache.maven.plugin.MojoNotFoundException;
029import org.apache.maven.plugin.PluginDescriptorParsingException;
030import org.apache.maven.plugin.PluginNotFoundException;
031import org.apache.maven.plugin.PluginResolutionException;
032import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException;
033import org.apache.maven.plugin.version.PluginVersionResolutionException;
034import org.apache.maven.project.MavenProject;
035
036import java.util.List;
037
038/**
039 * @since 3.0
040 * @author Benjamin Bentmann
041 * @author Kristian Rosenvold  (extract interface only)
042 *         <p/>
043 */
044public interface LifecycleExecutionPlanCalculator
045{
046    MavenExecutionPlan calculateExecutionPlan( MavenSession session, MavenProject project, List<Object> tasks )
047        throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException,
048        PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException,
049        NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException;
050
051    MavenExecutionPlan calculateExecutionPlan( MavenSession session, MavenProject project, List<Object> tasks,
052                                               boolean setup )
053        throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException,
054        PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException,
055        NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException;
056
057    void calculateForkedExecutions( MojoExecution mojoExecution, MavenSession session )
058        throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException,
059        PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
060        LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException;
061
062    void setupMojoExecution( MavenSession session, MavenProject project, MojoExecution mojoExecution )
063        throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
064        MojoNotFoundException, InvalidPluginDescriptorException, NoPluginFoundForPrefixException,
065        LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException;
066
067}