001package org.apache.maven.execution;
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 java.util.List;
023
024import org.apache.maven.plugin.MojoExecution;
025import org.apache.maven.project.MavenProject;
026
027/**
028 * Encapsulates parameters of ProjectExecutionListener callback methods and is meant to provide API evolution path
029 * should it become necessary to introduce new parameters in the existing callbacks in the future.
030 *
031 * @see ProjectExecutionListener
032 * @since 3.1.2
033 * @provisional This class is part of work in progress and can be changed or removed without notice.
034 */
035public class ProjectExecutionEvent
036{
037
038    private final MavenSession session;
039
040    private final MavenProject project;
041
042    private final List<MojoExecution> executionPlan;
043
044    private final Throwable cause;
045
046    public ProjectExecutionEvent( MavenSession session, MavenProject project )
047    {
048        this( session, project, null, null );
049    }
050
051    public ProjectExecutionEvent( MavenSession session, MavenProject project, List<MojoExecution> executionPlan )
052    {
053        this( session, project, executionPlan, null );
054    }
055
056    public ProjectExecutionEvent( MavenSession session, MavenProject project, Throwable cause )
057    {
058        this( session, project, null, cause );
059    }
060
061    public ProjectExecutionEvent( MavenSession session, MavenProject project, List<MojoExecution> executionPlan,
062                                  Throwable cause )
063    {
064        this.session = session;
065        this.project = project;
066        this.executionPlan = executionPlan;
067        this.cause = cause;
068    }
069
070    public MavenSession getSession()
071    {
072        return session;
073    }
074
075    public MavenProject getProject()
076    {
077        return project;
078    }
079
080    public List<MojoExecution> getExecutionPlan()
081    {
082        return executionPlan;
083    }
084
085    public Throwable getCause()
086    {
087        return cause;
088    }
089
090}