org.apache.maven.project
public class DefaultMavenProjectBuilder extends AbstractLogEnabled implements MavenProjectBuilder
Modifier and Type | Field and Description |
---|---|
protected ArtifactMetadataSource |
artifactMetadataSource |
protected ArtifactResolver |
artifactResolver |
static java.lang.String |
MAVEN_MODEL_VERSION |
protected MavenProfilesBuilder |
profilesBuilder |
ROLE, STANDALONE_SUPERPOM_ARTIFACTID, STANDALONE_SUPERPOM_GROUPID, STANDALONE_SUPERPOM_VERSION
Constructor and Description |
---|
DefaultMavenProjectBuilder() |
Modifier and Type | Method and Description |
---|---|
MavenProject |
build(java.io.File projectDescriptor,
ArtifactRepository localRepository,
ProfileManager profileManager) |
MavenProject |
build(java.io.File projectDescriptor,
ArtifactRepository localRepository,
ProfileManager profileManager,
boolean checkDistributionManagementStatus) |
MavenProject |
build(java.io.File pom,
ProjectBuilderConfiguration config) |
MavenProject |
build(java.io.File pom,
ProjectBuilderConfiguration config,
boolean checkDistributionManagementStatus) |
MavenProject |
buildFromRepository(Artifact artifact,
java.util.List remoteArtifactRepositories,
ArtifactRepository localRepository)
Build the artifact from the local repository, resolving it if necessary.
|
MavenProject |
buildFromRepository(Artifact artifact,
java.util.List remoteArtifactRepositories,
ArtifactRepository localRepository,
boolean allowStubModel)
Build the artifact from the local repository, resolving it if necessary.
|
MavenProject |
buildStandaloneSuperProject(ArtifactRepository localRepository) |
MavenProject |
buildStandaloneSuperProject(ArtifactRepository localRepository,
ProfileManager profileManager)
need to pass a profilemanager with correct context (eg.
|
MavenProject |
buildStandaloneSuperProject(ProjectBuilderConfiguration config) |
MavenProject |
buildWithDependencies(java.io.File projectDescriptor,
ArtifactRepository localRepository,
ProfileManager profileManager) |
MavenProject |
buildWithDependencies(java.io.File projectDescriptor,
ArtifactRepository localRepository,
ProfileManager profileManager,
TransferListener transferListener) |
void |
calculateConcreteState(MavenProject project,
ProjectBuilderConfiguration config)
Variant of
MavenProjectBuilder.calculateConcreteState(MavenProject, ProjectBuilderConfiguration, boolean)
which assumes that project references should be processed. |
void |
calculateConcreteState(MavenProject project,
ProjectBuilderConfiguration config,
boolean processProjectReferences)
Up to this point, the build section of the POM remains uninterpolated except for the artifact coordinates
it contains.
|
void |
contextualize(Context context) |
protected java.util.Set |
createExtensionArtifacts(java.lang.String projectId,
java.util.List extensions) |
protected java.util.Set |
createPluginArtifacts(java.lang.String projectId,
java.util.List plugins) |
protected java.util.Set |
createReportArtifacts(java.lang.String projectId,
java.util.List reports) |
void |
initialize() |
void |
restoreDynamicState(MavenProject project,
ProjectBuilderConfiguration config) |
void |
restoreDynamicState(MavenProject project,
ProjectBuilderConfiguration config,
boolean processProjectReferences) |
protected MavenProfilesBuilder profilesBuilder
protected ArtifactResolver artifactResolver
protected ArtifactMetadataSource artifactMetadataSource
public static final java.lang.String MAVEN_MODEL_VERSION
public void initialize()
public MavenProject build(java.io.File pom, ProjectBuilderConfiguration config) throws ProjectBuildingException
build
in interface MavenProjectBuilder
ProjectBuildingException
public MavenProject build(java.io.File pom, ProjectBuilderConfiguration config, boolean checkDistributionManagementStatus) throws ProjectBuildingException
build
in interface MavenProjectBuilder
ProjectBuildingException
public MavenProject build(java.io.File projectDescriptor, ArtifactRepository localRepository, ProfileManager profileManager) throws ProjectBuildingException
build
in interface MavenProjectBuilder
ProjectBuildingException
public MavenProject build(java.io.File projectDescriptor, ArtifactRepository localRepository, ProfileManager profileManager, boolean checkDistributionManagementStatus) throws ProjectBuildingException
build
in interface MavenProjectBuilder
ProjectBuildingException
public MavenProject buildFromRepository(Artifact artifact, java.util.List remoteArtifactRepositories, ArtifactRepository localRepository, boolean allowStubModel) throws ProjectBuildingException
MavenProjectBuilder
buildFromRepository
in interface MavenProjectBuilder
artifact
- the artifact descriptionremoteArtifactRepositories
- the remote repository listlocalRepository
- the local repositoryallowStubModel
- return a stub if the POM is not foundProjectBuildingException
public MavenProject buildFromRepository(Artifact artifact, java.util.List remoteArtifactRepositories, ArtifactRepository localRepository) throws ProjectBuildingException
MavenProjectBuilder
buildFromRepository
in interface MavenProjectBuilder
artifact
- the artifact descriptionremoteArtifactRepositories
- the remote repository listlocalRepository
- the local repositoryProjectBuildingException
public MavenProject buildStandaloneSuperProject(ArtifactRepository localRepository) throws ProjectBuildingException
buildStandaloneSuperProject
in interface MavenProjectBuilder
ProjectBuildingException
public MavenProject buildStandaloneSuperProject(ArtifactRepository localRepository, ProfileManager profileManager) throws ProjectBuildingException
MavenProjectBuilder
buildStandaloneSuperProject
in interface MavenProjectBuilder
ProjectBuildingException
public MavenProject buildStandaloneSuperProject(ProjectBuilderConfiguration config) throws ProjectBuildingException
buildStandaloneSuperProject
in interface MavenProjectBuilder
ProjectBuildingException
public MavenProject buildWithDependencies(java.io.File projectDescriptor, ArtifactRepository localRepository, ProfileManager profileManager) throws ProjectBuildingException, ArtifactResolutionException, ArtifactNotFoundException
buildWithDependencies
in interface MavenProjectBuilder
ProjectBuildingException
ArtifactResolutionException
ArtifactNotFoundException
public MavenProject buildWithDependencies(java.io.File projectDescriptor, ArtifactRepository localRepository, ProfileManager profileManager, TransferListener transferListener) throws ProjectBuildingException, ArtifactResolutionException, ArtifactNotFoundException
buildWithDependencies
in interface MavenProjectBuilder
ProjectBuildingException
ArtifactResolutionException
ArtifactNotFoundException
protected java.util.Set createPluginArtifacts(java.lang.String projectId, java.util.List plugins) throws ProjectBuildingException
ProjectBuildingException
protected java.util.Set createReportArtifacts(java.lang.String projectId, java.util.List reports) throws ProjectBuildingException
ProjectBuildingException
protected java.util.Set createExtensionArtifacts(java.lang.String projectId, java.util.List extensions) throws ProjectBuildingException
ProjectBuildingException
public void contextualize(Context context) throws ContextException
ContextException
public void calculateConcreteState(MavenProject project, ProjectBuilderConfiguration config) throws ModelInterpolationException
MavenProjectBuilder.calculateConcreteState(MavenProject, ProjectBuilderConfiguration, boolean)
which assumes that project references should be processed. This is provided for performance reasons, for cases
where you know all projects in the reactor will be processed, making traversal of project references unnecessary.calculateConcreteState
in interface MavenProjectBuilder
ModelInterpolationException
public void calculateConcreteState(MavenProject project, ProjectBuilderConfiguration config, boolean processProjectReferences) throws ModelInterpolationException
MavenProjectBuilder#restoreDynamicState(MavenProject, ProjectBuilderConfiguration, boolean)
method, this method allows expressions in these areas of the POM and project instance to
be reevaluated in the event that a mojo changes one the build-path values, or a project property.
calculateConcreteState
in interface MavenProjectBuilder
ModelInterpolationException
public void restoreDynamicState(MavenProject project, ProjectBuilderConfiguration config) throws ModelInterpolationException
ModelInterpolationException
public void restoreDynamicState(MavenProject project, ProjectBuilderConfiguration config, boolean processProjectReferences) throws ModelInterpolationException
ModelInterpolationException