Package org.apache.maven.project
Class DefaultProjectBuilder
java.lang.Object
org.apache.maven.project.DefaultProjectBuilder
- All Implemented Interfaces:
ProjectBuilder
DefaultProjectBuilder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
(package private) static class
private static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ProjectDependenciesResolver
private final LifecycleBindingsInjector
private final org.slf4j.Logger
private final ModelBuilder
private final ProjectBuildingHelper
private final MavenRepositorySystem
private final org.eclipse.aether.RepositorySystem
private final RootLocator
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultProjectBuilder
(ModelBuilder modelBuilder, ProjectBuildingHelper projectBuildingHelper, MavenRepositorySystem repositorySystem, org.eclipse.aether.RepositorySystem repoSystem, ProjectDependenciesResolver dependencyResolver, RootLocator rootLocator, LifecycleBindingsInjector lifecycleBindingsInjector) -
Method Summary
Modifier and TypeMethodDescriptionbuild
(File pomFile, 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
(ModelSource modelSource, ProjectBuildingRequest request) Builds a project descriptor for the specified model source.build
(Artifact artifact, boolean allowStubModel, ProjectBuildingRequest request) Builds a project descriptor for the specified artifact.build
(Artifact artifact, ProjectBuildingRequest request) Builds a project descriptor for the specified artifact.build
(ModelSource modelSource, ProjectBuildingRequest request) Deprecated.private static ModelSource
createStubModelSource
(Artifact artifact) (package private) static String
getGroupId
(Model model) getProfileIds
(List<Profile> profiles) (package private) static String
getVersion
(Model model) private Model
injectLifecycleBindings
(Model model, ModelBuilderRequest request, ModelProblemCollector problems, MavenProject project, ProjectBuildingRequest projectBuildingRequest) toMap
(Properties properties) (package private) static ModelSource
toSource
(ModelSource modelSource) Deprecated.
-
Field Details
-
logger
private final org.slf4j.Logger logger -
modelBuilder
-
projectBuildingHelper
-
repositorySystem
-
repoSystem
private final org.eclipse.aether.RepositorySystem repoSystem -
dependencyResolver
-
rootLocator
-
lifecycleBindingsInjector
-
-
Constructor Details
-
DefaultProjectBuilder
@Inject public DefaultProjectBuilder(ModelBuilder modelBuilder, ProjectBuildingHelper projectBuildingHelper, MavenRepositorySystem repositorySystem, org.eclipse.aether.RepositorySystem repoSystem, ProjectDependenciesResolver dependencyResolver, RootLocator rootLocator, LifecycleBindingsInjector lifecycleBindingsInjector)
-
-
Method Details
-
build
public ProjectBuildingResult build(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
@Deprecated public ProjectBuildingResult build(ModelSource modelSource, ProjectBuildingRequest request) throws ProjectBuildingException Deprecated.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 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:
-
toSource
Deprecated. -
build
public ProjectBuildingResult build(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 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
public ProjectBuildingResult build(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(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 List<ProjectBuildingResult> build(List<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 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.
-
getProfileIds
-
createStubModelSource
-
getGroupId
-
getVersion
-
toMap
-
injectLifecycleBindings
private Model injectLifecycleBindings(Model model, ModelBuilderRequest request, ModelProblemCollector problems, MavenProject project, ProjectBuildingRequest projectBuildingRequest)
-