1 package org.apache.maven.api.services;
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.api.annotations.Experimental;
23 import org.apache.maven.api.annotations.Nonnull;
24
25 import java.nio.file.Path;
26 import java.util.Collection;
27 import java.util.Optional;
28
29 import org.apache.maven.api.Project;
30
31 /**
32 * Result of a project build call.
33 *
34 * @since 4.0
35 */
36 @Experimental
37 public interface ProjectBuilderResult
38 {
39
40 /**
41 * Gets the identifier of the project that could not be built. The general format of the identifier is {@code
42 * <groupId>:<artifactId>:<version>} but some of these coordinates may still be unknown at the point the exception
43 * is thrown so this information is merely meant to assist the user.
44 *
45 * @return The identifier of the project or an empty string if not known, never {@code null}.
46 */
47 @Nonnull
48 String getProjectId();
49
50 /**
51 * Gets the POM file from which the project was built.
52 *
53 * @return The optional POM file.
54 */
55 @Nonnull
56 Optional<Path> getPomFile();
57
58 /**
59 * Gets the project that was built.
60 *
61 * @return The project that was built or {@code null} if an error occurred and this result accompanies a
62 * {@link ProjectBuilderException}.
63 */
64 @Nonnull
65 Optional<Project> getProject();
66
67 /**
68 * Gets the problems that were encountered during the project building.
69 *
70 * @return The problems that were encountered during the project building, can be empty but never {@code null}.
71 */
72 @Nonnull
73 Collection<ProjectBuilderProblem> getProblems();
74
75 /**
76 * Gets the result of the dependency resolution for the project.
77 *
78 * @return The result of the dependency resolution for the project.
79 */
80 @Nonnull
81 Optional<DependencyCollectorResult> getDependencyResolverResult();
82
83 }