001package org.apache.maven.project;
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.io.File;
023import java.util.List;
024
025import org.apache.maven.model.building.ModelProblem;
026
027/**
028 * Collects the output of the project builder.
029 *
030 * @author Benjamin Bentmann
031 */
032public interface ProjectBuildingResult
033{
034
035    /**
036     * Gets the identifier of the project that could not be built. The general format of the identifier is {@code
037     * <groupId>:<artifactId>:<version>} but some of these coordinates may still be unknown at the point the exception
038     * is thrown so this information is merely meant to assist the user.
039     *
040     * @return The identifier of the project or an empty string if not known, never {@code null}.
041     */
042    String getProjectId();
043
044    /**
045     * Gets the POM file from which the project was built.
046     *
047     * @return The POM file or {@code null} if unknown.
048     */
049    File getPomFile();
050
051    /**
052     * Gets the project that was built.
053     *
054     * @return The project that was built or {@code null} if an error occurred and this result accompanies a
055     *         {@link ProjectBuildingException}.
056     */
057    MavenProject getProject();
058
059    /**
060     * Gets the problems that were encountered during the project building.
061     *
062     * @return The problems that were encountered during the project building, can be empty but never {@code null}.
063     */
064    List<ModelProblem> getProblems();
065
066    /**
067     * Gets the result of the dependency resolution for the project.
068     *
069     * @return The result of the dependency resolution for the project or {@code null} if the project dependencies were
070     *         not requested.
071     */
072    DependencyResolutionResult getDependencyResolutionResult();
073
074}