Package org.apache.maven.project
Class DefaultProjectBuilder
- java.lang.Object
-
- org.apache.maven.project.DefaultProjectBuilder
-
- All Implemented Interfaces:
ProjectBuilder
@Component(role=ProjectBuilder.class) public class DefaultProjectBuilder extends java.lang.Object implements ProjectBuilder
DefaultProjectBuilder
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DISABLE_GLOBAL_MODEL_CACHE_SYSTEM_PROPERTY
-
Constructor Summary
Constructors Constructor Description DefaultProjectBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProjectBuildingResult
build(java.io.File pomFile, ProjectBuildingRequest request)
Builds a project descriptor from the specified POM file.java.util.List<ProjectBuildingResult>
build(java.util.List<java.io.File> pomFiles, boolean recursive, ProjectBuildingRequest request)
Builds the projects for the specified POM files and optionally their children.ProjectBuildingResult
build(org.apache.maven.artifact.Artifact artifact, boolean allowStubModel, ProjectBuildingRequest request)
Builds a project descriptor for the specified artifact.ProjectBuildingResult
build(org.apache.maven.artifact.Artifact artifact, ProjectBuildingRequest request)
Builds a project descriptor for the specified artifact.ProjectBuildingResult
build(org.apache.maven.model.building.ModelSource modelSource, ProjectBuildingRequest request)
Builds a project descriptor for the specified model source.
-
-
-
Field Detail
-
DISABLE_GLOBAL_MODEL_CACHE_SYSTEM_PROPERTY
public static final java.lang.String DISABLE_GLOBAL_MODEL_CACHE_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
build
public ProjectBuildingResult build(java.io.File pomFile, ProjectBuildingRequest request) throws ProjectBuildingException
Description copied from interface:ProjectBuilder
Builds a project descriptor from the specified POM file.- Specified by:
build
in interfaceProjectBuilder
- Parameters:
pomFile
- 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
public ProjectBuildingResult build(org.apache.maven.model.building.ModelSource modelSource, ProjectBuildingRequest request) throws ProjectBuildingException
Description copied from interface:ProjectBuilder
Builds a project descriptor for the specified model source.- Specified by:
build
in interfaceProjectBuilder
- Parameters:
modelSource
- The source of the model to built 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:
ModelSource2
-
build
public ProjectBuildingResult build(org.apache.maven.artifact.Artifact artifact, ProjectBuildingRequest request) throws ProjectBuildingException
Description copied from interface:ProjectBuilder
Builds a project descriptor for the specified artifact.- Specified by:
build
in interfaceProjectBuilder
- Parameters:
artifact
- 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
public ProjectBuildingResult build(org.apache.maven.artifact.Artifact artifact, boolean allowStubModel, ProjectBuildingRequest request) throws ProjectBuildingException
Description copied from interface:ProjectBuilder
Builds a project descriptor for the specified artifact.- Specified by:
build
in interfaceProjectBuilder
- Parameters:
artifact
- 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
public java.util.List<ProjectBuildingResult> build(java.util.List<java.io.File> pomFiles, boolean recursive, ProjectBuildingRequest request) throws ProjectBuildingException
Description copied from interface:ProjectBuilder
Builds the projects for the specified POM files and optionally their children.- Specified by:
build
in interfaceProjectBuilder
- Parameters:
pomFiles
- The POM files to build, must not benull
.recursive
-true
to recursively build sub modules 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.
-
-