View Javadoc

1   package org.apache.maven.lifecycle;
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.execution.MavenSession;
23  import org.apache.maven.model.Plugin;
24  import org.apache.maven.plugin.InvalidPluginDescriptorException;
25  import org.apache.maven.plugin.MojoExecution;
26  import org.apache.maven.plugin.MojoNotFoundException;
27  import org.apache.maven.plugin.PluginDescriptorParsingException;
28  import org.apache.maven.plugin.PluginManagerException;
29  import org.apache.maven.plugin.PluginNotFoundException;
30  import org.apache.maven.plugin.PluginResolutionException;
31  import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException;
32  import org.apache.maven.plugin.version.PluginVersionResolutionException;
33  import org.apache.maven.project.MavenProject;
34  
35  import java.util.List;
36  import java.util.Set;
37  
38  /**
39   * A facade that provides lifecycle services to components outside maven core.
40   *
41   *
42   * @author Jason van  Zyl
43   */
44  @SuppressWarnings( { "UnusedDeclaration" } )
45  public interface LifecycleExecutor
46  {
47  
48      // USED BY MAVEN HELP PLUGIN
49      @Deprecated
50      String ROLE = LifecycleExecutor.class.getName();
51  
52      // For a given project packaging find all the plugins that are bound to any registered
53      // lifecycles. The project builder needs to now what default plugin information needs to be
54      // merged into POM being built. Once the POM builder has this plugin information, versions can be assigned
55      // by the POM builder because they will have to be defined in plugin management. Once this is setComplete then it
56      // can be passed back so that the default configuraiton information can be populated.
57      //
58      // We need to know the specific version so that we can lookup the right version of the plugin descriptor
59      // which tells us what the default configuration is.
60      //
61  
62      /**
63       * @return The plugins bound to the lifecycles of the specified packaging or {@code null} if the packaging is
64       *         unknown.
65       */
66      Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging );
67  
68      MavenExecutionPlan calculateExecutionPlan( MavenSession session, String... tasks )
69          throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
70          MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
71          PluginManagerException, LifecyclePhaseNotFoundException, LifecycleNotFoundException,
72          PluginVersionResolutionException;
73  
74      void execute( MavenSession session );
75  
76      // used by the site plugin 3.x
77      void calculateForkedExecutions( MojoExecution mojoExecution, MavenSession session )
78          throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException,
79          PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
80          LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException;
81  
82  
83      // used by the site plugin 3.x
84      List<MavenProject> executeForkedExecutions( MojoExecution mojoExecution, MavenSession session )
85          throws LifecycleExecutionException;
86  
87  
88  }