Package org.apache.maven.project
Interface ProjectBuilder
- All Known Implementing Classes:
DefaultProjectBuilder
public interface ProjectBuilder
Builds in-memory descriptions of projects.
-
Method Summary
Modifier and TypeMethodDescriptionbuild
(File projectFile, ProjectBuildingRequest request) Builds a project descriptor from the specified POM file.build
(List<File> pomFiles, boolean recursive, ProjectBuildingRequest request) Builds the projects for the specified POM files and optionally their children.build
(Artifact projectArtifact, boolean allowStubModel, ProjectBuildingRequest request) Builds a project descriptor for the specified artifact.build
(Artifact projectArtifact, ProjectBuildingRequest request) Builds a project descriptor for the specified artifact.build
(ModelSource modelSource, ProjectBuildingRequest request) Builds a project descriptor for the specified model source.
-
Method Details
-
build
ProjectBuildingResult build(File projectFile, ProjectBuildingRequest request) throws ProjectBuildingException Builds a project descriptor from the specified POM file.- Parameters:
projectFile
- The POM file to build the project from, must not benull
.request
- The project building request that holds further parameters, must not benull
.- Returns:
- The result of the project building, never
null
. - Throws:
ProjectBuildingException
- If the project descriptor could not be successfully built.
-
build
ProjectBuildingResult build(Artifact projectArtifact, ProjectBuildingRequest request) throws ProjectBuildingException Builds a project descriptor for the specified artifact.- Parameters:
projectArtifact
- The POM artifact to build the project from, must not benull
.request
- The project building request that holds further parameters, must not benull
.- Returns:
- The result of the project building, never
null
. - Throws:
ProjectBuildingException
- If the project descriptor could not be successfully built.
-
build
ProjectBuildingResult build(Artifact projectArtifact, boolean allowStubModel, ProjectBuildingRequest request) throws ProjectBuildingException Builds a project descriptor for the specified artifact.- Parameters:
projectArtifact
- The POM artifact to build the project from, must not benull
.allowStubModel
- A flag controlling the case of a missing POM artifact. Iftrue
and the specified POM artifact does not exist, a simple stub model will be returned. Iffalse
, an exception will be thrown.request
- The project building request that holds further parameters, must not benull
.- Returns:
- The result of the project building, never
null
. - Throws:
ProjectBuildingException
- If the project descriptor could not be successfully built.
-
build
ProjectBuildingResult build(ModelSource modelSource, ProjectBuildingRequest request) throws ProjectBuildingException Builds a project descriptor for the specified model source.- Parameters:
modelSource
- The source of the model to build the project descriptor from, must not benull
.request
- The project building request that holds further parameters, must not benull
.- Returns:
- The result of the project building, never
null
. - Throws:
ProjectBuildingException
- If the project descriptor could not be successfully built.- See Also:
-
build
List<ProjectBuildingResult> build(List<File> pomFiles, boolean recursive, ProjectBuildingRequest request) throws ProjectBuildingException Builds the projects for the specified POM files and optionally their children.- Parameters:
pomFiles
- The POM files to build, must not benull
.recursive
-true
to recursively build submodules referenced by the POM files,false
to build only the specified POM files.request
- The project builder configuration that provides further parameters, must not benull
.- Returns:
- The results of the project builder where each result corresponds to one project that was built, never
null
. - Throws:
ProjectBuildingException
- If an error was encountered during building of any project.ProjectBuildingException.getResults()
provides access to the details of the problems.
-