View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.execution;
20  
21  import java.util.List;
22  import org.apache.maven.project.DependencyResolutionResult;
23  import org.apache.maven.project.MavenProject;
24  
25  /**
26   * @author Jason van Zyl
27   */
28  public interface MavenExecutionResult {
29      MavenExecutionResult setProject(MavenProject project);
30  
31      MavenProject getProject();
32  
33      MavenExecutionResult setTopologicallySortedProjects(List<MavenProject> projects);
34  
35      /**
36       * @return the sorted list, or an empty list if there are no projects.
37       */
38      List<MavenProject> getTopologicallySortedProjects();
39  
40      MavenExecutionResult setDependencyResolutionResult(DependencyResolutionResult result);
41  
42      DependencyResolutionResult getDependencyResolutionResult();
43  
44      // for each exception
45      // - knowing what artifacts are missing
46      // - project building exception
47      // - invalid project model exception: list of markers
48      // - xmlpull parser exception
49      List<Throwable> getExceptions();
50  
51      MavenExecutionResult addException(Throwable e);
52  
53      boolean hasExceptions();
54  
55      /**
56       * Gets the build summary for the specified project.
57       *
58       * @param project The project to get the build summary for, must not be {@code null}.
59       * @return The build summary for the project or {@code null} if the project has not been built (yet).
60       */
61      BuildSummary getBuildSummary(MavenProject project);
62  
63      /**
64       * Add the specified build summary.
65       *
66       * @param summary The build summary to add, must not be {@code null}.
67       */
68      void addBuildSummary(BuildSummary summary);
69  
70      /**
71       * Indicates whether or not the build could be resumed by a second invocation of Maven.
72       * @see BuildResumptionDataRepository
73       * @return <code>true</code> when it is possible to resume the build, <code>false</code> otherwise.
74       */
75      boolean canResume();
76  
77      /**
78       * Indicate that the build can or cannot be resumed by a second invocation of Maven.
79       * @param canResume <code>true</code> when it is possible to resume the build, <code>false</code> otherwise.
80       * @see BuildResumptionDataRepository
81       * @see #canResume()
82       */
83      void setCanResume(boolean canResume);
84  }